fix: tabbar 2个BUG
This commit is contained in:
parent
d6c6022a18
commit
7271f3c618
@ -34,4 +34,8 @@ function selectTabBar({ value: index }: { value: number }) {
|
||||
tabbarStore.setCurIdx(index)
|
||||
uni.switchTab({ url })
|
||||
}
|
||||
onLoad(() => {
|
||||
// 解决原生 tabBar 未隐藏导致有2个 tabBar 的问题
|
||||
uni.hideTabBar()
|
||||
})
|
||||
</script>
|
||||
|
@ -13,9 +13,13 @@ export const tabbarList = [
|
||||
},
|
||||
]
|
||||
|
||||
/**
|
||||
* tabbar 状态,增加 storageSync 保证刷新浏览器时在正确的 tabbar 页面
|
||||
*/
|
||||
export const tabbarStore = reactive({
|
||||
curIdx: 0,
|
||||
curIdx: uni.getStorageSync('curIdx') || 0,
|
||||
setCurIdx(idx: number) {
|
||||
this.curIdx = idx
|
||||
uni.setStorageSync('curIdx', idx)
|
||||
},
|
||||
})
|
||||
|
@ -48,10 +48,6 @@ const description = ref(
|
||||
onLoad(() => {
|
||||
console.log(author)
|
||||
})
|
||||
onLoad(() => {
|
||||
// tabbar模板,直接在首页隐藏即可,全局只需要这一次
|
||||
uni.hideTabBar()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
Loading…
x
Reference in New Issue
Block a user