首页底部
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
+19
View File
@@ -30,7 +30,26 @@ export default {
default: ''
}
},
mounted() {
// 首次测量
this.$nextTick(() => this.emitHeight())
},
watch: {
// 国家列表变化 → 换行行数可能变化 → 重新测量
'list.length'() {
this.$nextTick(() => this.emitHeight())
}
},
methods: {
emitHeight() {
const query = uni.createSelectorQuery().in(this)
query.select('#countryBar').boundingClientRect()
query.exec((res) => {
if (res && res[0]) {
this.$emit('height-change', res[0].height)
}
})
},
selectItem(item) {
this.$emit('select', item.id)
}