uni-app dynamically acquiring element height

uni.getSystemInfo ({
  Success: function (RES) {// RES - various parameters
     console.log (res.windowWidth); // screen width 

      let info = uni.createSelectorQuery () select; . ( " class name.")
      info.boundingClientRect (function (Data) {// Data - various parameters
      console.log (data.width) // Get the width of the element
      }). Exec ()
       }
});

Guess you like

Origin www.cnblogs.com/lymconch/p/11286795.html