• 微信小程序,uniapp,uview获得元素高度


    微信小程序:

    let query = wx.createSelectorQuery();
    query.select('.find').boundingClientRect(res => {
        console.log(res.height);   // 1545.7249755859375
     }).exec();

    uniap:

    uni.getSystemInfo({
      success: function(res) { // res - 各种参数
         console.log(res.windowWidth); // 屏幕的宽度 
    
          let info = uni.createSelectorQuery().select(".类名");
          info.boundingClientRect(function(data) { //data - 各种参数
          console.log(data.width)  // 获取元素宽度
          }).exec()
           }
    });

    uview:

    export default {
        methods: {
            async getElInfo() {
                let rectInfo = await this.$u.getRect('.类名');
                console.log(rectInfo);
            }
        }
    }

    转: 

    https://v1.uviewui.com/js/getRect.html

    https://blog.csdn.net/admin_web/article/details/117359984

    https://www.csdn.net/tags/NtzaYg0sODgzODYtYmxvZwO0O0OO0O0O.html

  • 相关阅读:
    Bluedroid介绍
    Android蓝牙介绍
    Android Bluetooth抓包
    Bluetooth LMP介绍
    Bluetooth Baseband介绍
    Bluetooth SDP介绍
    Bluetooth HFP介绍
    Bluetooth RFCOMM介绍
    Bluetooth L2CAP介绍
    Windows开发
  • 原文地址:https://www.cnblogs.com/fps2tao/p/16144376.html
Copyright © 2020-2023  润新知