fix: tabbar 2个BUG

This commit is contained in:
菲鸽 2024-05-11 11:32:34 +08:00
parent d6c6022a18
commit 7271f3c618
3 changed files with 9 additions and 5 deletions

View File

@ -34,4 +34,8 @@ function selectTabBar({ value: index }: { value: number }) {
tabbarStore.setCurIdx(index) tabbarStore.setCurIdx(index)
uni.switchTab({ url }) uni.switchTab({ url })
} }
onLoad(() => {
// tabBar 2 tabBar
uni.hideTabBar()
})
</script> </script>

View File

@ -13,9 +13,13 @@ export const tabbarList = [
}, },
] ]
/**
* tabbar storageSync tabbar
*/
export const tabbarStore = reactive({ export const tabbarStore = reactive({
curIdx: 0, curIdx: uni.getStorageSync('curIdx') || 0,
setCurIdx(idx: number) { setCurIdx(idx: number) {
this.curIdx = idx this.curIdx = idx
uni.setStorageSync('curIdx', idx)
}, },
}) })

View File

@ -48,10 +48,6 @@ const description = ref(
onLoad(() => { onLoad(() => {
console.log(author) console.log(author)
}) })
onLoad(() => {
// tabbar
uni.hideTabBar()
})
</script> </script>
<style> <style>