|
@@ -1,10 +1,10 @@
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
import { tabbarStore } from './tabbar'
|
|
import { tabbarStore } from './tabbar'
|
|
|
// 'i-carbon-code',
|
|
// 'i-carbon-code',
|
|
|
-import { tabbarList as _tabBarList, cacheTabbarEnable, selectedTabbarStrategy } from './tabbarList'
|
|
|
|
|
|
|
+import { tabbarList as _tabBarList, cacheTabbarEnable, selectedTabbarStrategy, TABBAR_MAP } from './tabbarList'
|
|
|
|
|
|
|
|
// @ts-expect-error 预知的判断
|
|
// @ts-expect-error 预知的判断
|
|
|
-const customTabbarEnable = selectedTabbarStrategy === 2 || selectedTabbarStrategy === 3
|
|
|
|
|
|
|
+const customTabbarEnable = selectedTabbarStrategy === TABBAR_MAP.CUSTOM_TABBAR_WITH_CACHE || selectedTabbarStrategy === TABBAR_MAP.CUSTOM_TABBAR_NO_CACHE
|
|
|
/** tabbarList 里面的 path 从 pages.config.ts 得到 */
|
|
/** tabbarList 里面的 path 从 pages.config.ts 得到 */
|
|
|
const tabbarList = _tabBarList.map(item => ({ ...item, path: `/${item.pagePath}` }))
|
|
const tabbarList = _tabBarList.map(item => ({ ...item, path: `/${item.pagePath}` }))
|
|
|
function selectTabBar({ value: index }: { value: number }) {
|
|
function selectTabBar({ value: index }: { value: number }) {
|
|
@@ -20,7 +20,7 @@ function selectTabBar({ value: index }: { value: number }) {
|
|
|
onLoad(() => {
|
|
onLoad(() => {
|
|
|
// 解决原生 tabBar 未隐藏导致有2个 tabBar 的问题
|
|
// 解决原生 tabBar 未隐藏导致有2个 tabBar 的问题
|
|
|
// @ts-expect-error 预知的判断
|
|
// @ts-expect-error 预知的判断
|
|
|
- const hideRedundantTabbarEnable = selectedTabbarStrategy === 2
|
|
|
|
|
|
|
+ const hideRedundantTabbarEnable = selectedTabbarStrategy === TABBAR_MAP.CUSTOM_TABBAR_WITH_CACHE
|
|
|
hideRedundantTabbarEnable
|
|
hideRedundantTabbarEnable
|
|
|
&& uni.hideTabBar({
|
|
&& uni.hideTabBar({
|
|
|
fail(err) {
|
|
fail(err) {
|