首页底部
Test Runner / hello (push) Successful in 4s

This commit is contained in:
2026-08-25 18:12:16 +08:00
parent 69734f36b4
commit 4bee0101e7
22 changed files with 378 additions and 183 deletions
+13
View File
@@ -41,7 +41,20 @@ export default {
this.statusBarHeight = 20
}
},
mounted() {
// 测量自身高度并 emit 给父组件(小程序端无法跨组件查询 DOM,必须自测量)
this.$nextTick(() => this.emitHeight())
},
methods: {
emitHeight() {
const query = uni.createSelectorQuery().in(this)
query.select('#searchBar').boundingClientRect()
query.exec((res) => {
if (res && res[0]) {
this.$emit('height-change', res[0].height)
}
})
},
onInput(e) {
this.$emit('input', e.detail.value)
},