uni-app中打包App时,boundingClientRect无效的问题
问题: App内,rect首次无效
const query = uni.createSelectorQuery().in(getCurrentInstance().proxy); query .select('#botEnter') .boundingClientRect(rect => { }) .exec();
解决办法:采用this
uni .createSelectorQuery() .in(this) .select('#botEnter') .boundingClientRect(res => { console.log('=====res==botEnter==', res); resolve(res); }) .exec();