lifetimes: {
ready() {
setTimeout(() => {
const that = this;
const query = wx.createSelectorQuery().in(this);
query.select('#id').boundingClientRect();
query.exec(function (res) {
if (res[0]?.width || res[0]?.width > 0) {
// 组件宽度
const w = parseInt(res[0].width);
// 组件高度
const h = parseInt(res[0].height);
// 屏幕宽度
const windowWidth = wx.getSystemInfoSync().windowWidth;
}
});
}, 200);
},
}
08-05