//先引入 getCurrentInstance
import {
ref,
getCurrentInstance,
onMounted
} from "vue"
//实例化getCurrentInstance
let _this = getCurrentInstance();
// 获取某个元素的高度
let getPropety=()=>{
const query = uni.createSelectorQuery().in(_this);
query.select('.headerHei').boundingClientRect(data => {
let newdata = JSON.parse(JSON.stringify(data))
yaoHei.value = yaoHei.value - newdata.height
}).exec();
}
onMounted(()=>{
getPropety()
})
uniapp中vue3怎么获取某个节点的信息
最新推荐文章于 2024-10-08 16:43:31 发布