diff --git a/src/pages/about/about.vue b/src/pages/about/about.vue index 6c0fbfa..438b922 100644 --- a/src/pages/about/about.vue +++ b/src/pages/about/about.vue @@ -57,7 +57,7 @@ function gotoTabbar() { } // #region setTabbarBadge function setTabbarBadge() { - tabbarStore.setTabbarItemBadge(3, 10) + tabbarStore.setTabbarItemBadge(1, 10) } // #endregion diff --git a/src/tabbar/store.ts b/src/tabbar/store.ts index 9753996..ad36410 100644 --- a/src/tabbar/store.ts +++ b/src/tabbar/store.ts @@ -1,14 +1,16 @@ import type { CustomTabBarItem, CustomTabBarItemBadge } from './config' +import { reactive } from 'vue' + import { tabbarList as _tabbarList, customTabbarEnable } from './config' // TODO 1/2: 中间的鼓包tabbarItem的开关 const BULGE_ENABLE = false /** tabbarList 里面的 path 从 pages.config.ts 得到 */ -const tabbarList: CustomTabBarItem[] = _tabbarList.map(item => ({ +const tabbarList = reactive(_tabbarList.map(item => ({ ...item, pagePath: item.pagePath.startsWith('/') ? item.pagePath : `/${item.pagePath}`, -})) +}))) if (customTabbarEnable && BULGE_ENABLE) { if (tabbarList.length % 2) {