修复tabbar的问题
This commit is contained in:
parent
9595769d46
commit
20b7c760fd
|
|
@ -1,5 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<u-tabbar
|
<u-tabbar
|
||||||
|
v-if="showTabbar"
|
||||||
v-model="current"
|
v-model="current"
|
||||||
v-bind="tabbarStyle"
|
v-bind="tabbarStyle"
|
||||||
:list="tabbarList"
|
: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(() => ({
|
const tabbarStyle = computed(() => ({
|
||||||
activeColor: appStore.getStyleConfig.selectedColor,
|
activeColor: appStore.getStyleConfig.selectedColor,
|
||||||
inactiveColor: appStore.getStyleConfig.defaultColor
|
inactiveColor: appStore.getStyleConfig.defaultColor
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue