修复tabbar的问题

This commit is contained in:
Jason 2023-01-17 15:56:12 +08:00
parent 9595769d46
commit 20b7c760fd
1 changed files with 9 additions and 0 deletions

View File

@ -1,5 +1,6 @@
<template>
<u-tabbar
v-if="showTabbar"
v-model="current"
v-bind="tabbarStyle"
:list="tabbarList"
@ -27,6 +28,14 @@ const tabbarList = computed(() => {
})
})
const showTabbar = computed(() => {
const currentPages = getCurrentPages()
const currentPage = currentPages[currentPages.length - 1]
const current = tabbarList.value.findIndex((item: any) => {
return item.pagePath === '/' + currentPage.route
})
return current >= 0
})
const tabbarStyle = computed(() => ({
activeColor: appStore.getStyleConfig.selectedColor,
inactiveColor: appStore.getStyleConfig.defaultColor