diff --git a/src/components/fg-navbar/fg-navbar.vue b/src/components/fg-navbar/fg-navbar.vue
deleted file mode 100644
index dbde618..0000000
--- a/src/components/fg-navbar/fg-navbar.vue
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/src/layouts/fg-tabbar/fg-tabbar.vue b/src/layouts/fg-tabbar/fg-tabbar.vue
index 0079c25..556e481 100644
--- a/src/layouts/fg-tabbar/fg-tabbar.vue
+++ b/src/layouts/fg-tabbar/fg-tabbar.vue
@@ -3,12 +3,13 @@ import { tabbarStore } from './tabbar'
// 'i-carbon-code',
import { tabbarList as _tabBarList, cacheTabbarEnable, selectedTabbarStrategy } from './tabbarList'
+// @ts-expect-error 预料中的判断
const customTabbarEnable = selectedTabbarStrategy === 1 || selectedTabbarStrategy === 2
/** tabbarList 里面的 path 从 pages.config.ts 得到 */
const tabbarList = _tabBarList.map(item => ({ ...item, path: `/${item.pagePath}` }))
-function selectTabBar({ value: index }: { value: number }) {
- const url = tabbarList[index].path
- tabbarStore.setCurIdx(index)
+function selectTabBar(name: number) {
+ const url = tabbarList[name].path
+ tabbarStore.setCurIdx(name)
if (cacheTabbarEnable) {
uni.switchTab({ url })
}
@@ -18,6 +19,7 @@ function selectTabBar({ value: index }: { value: number }) {
}
onLoad(() => {
// 解决原生 tabBar 未隐藏导致有2个 tabBar 的问题
+ // @ts-expect-error 预料中的判断
const hideRedundantTabbarEnable = selectedTabbarStrategy === 1
hideRedundantTabbarEnable
&& uni.hideTabBar({
@@ -32,23 +34,26 @@ onLoad(() => {
-
-
-
{
:class="[item.icon, idx === tabbarStore.curIdx ? 'is-active' : 'is-inactive']"
/>
-
-
+
+
-
+
-
+
diff --git a/src/layouts/tabbar.vue b/src/layouts/tabbar.vue
index 0c1bb1c..e61c476 100644
--- a/src/layouts/tabbar.vue
+++ b/src/layouts/tabbar.vue
@@ -1,19 +1,10 @@
-
+
-
-
-
+