uniapp获取元素的高度
每次遇到类似的问题都去百度,但是呢,百度答案里面没有一个可用的,真实可行的。现做个记录。有这个需要的也可以直接抄。
mounted() {
this.resize()
},
methods: {
resize(){
const query = uni.createSelectorQuery().in(this);
query.select('.com-image').boundingClientRect((pos)=>{
console.log('p
原创
2022-02-09 18:53:42 ·
1691 阅读 ·
0 评论