mounted() {
this.getBoxSize();
},
methods: {
getBoxSize() {
uni.createSelectorQuery()
.select('.header')
.boundingClientRect((rect) => {
this.boxHeight = rect.height; // 盒子的高度,单位为px
})
.exec();
},
}
this.$nextTick(() => {});