diff --git a/pages.config.ts b/pages.config.ts
index cdbcb94..f2d86cb 100644
--- a/pages.config.ts
+++ b/pages.config.ts
@@ -27,16 +27,15 @@ export default defineUniPages({
spacing: '3px',
list: [
{
- iconPath: 'static/tabbar/home.png',
- selectedIconPath: 'static/tabbar/homeHL.png',
pagePath: 'pages/index/index',
+ icon: 'home',
text: '首页',
},
{
- iconPath: 'static/tabbar/example.png',
- selectedIconPath: 'static/tabbar/exampleHL.png',
- pagePath: 'pages/index/about',
- text: '关于',
+ pagePath: 'pages/my/index',
+ icon: 'i-carbon-user-avatar',
+ isUnocssIcon: true,
+ text: '我的',
},
],
},
diff --git a/src/components/fg-tabbar/fg-tabbar.vue b/src/components/fg-tabbar/fg-tabbar.vue
index 554286c..25dad4e 100644
--- a/src/components/fg-tabbar/fg-tabbar.vue
+++ b/src/components/fg-tabbar/fg-tabbar.vue
@@ -1,82 +1,37 @@
-
-
-
-
-
-
-
-
-
- {{ item.text }}
- {{ item.text }}
-
-
-
+
+
+
+
+
+
+
+
+
+
-
-
diff --git a/src/components/fg-tabbar/tabbar.ts b/src/components/fg-tabbar/tabbar.ts
new file mode 100644
index 0000000..479090c
--- /dev/null
+++ b/src/components/fg-tabbar/tabbar.ts
@@ -0,0 +1,21 @@
+export const tabbarList = [
+ {
+ path: '/pages/index/about',
+ icon: 'home',
+ isWotIcon: true,
+ title: '首页',
+ },
+ {
+ path: '/pages/index/index',
+ icon: 'i-carbon-user-avatar',
+ isWotIcon: false,
+ title: '我的',
+ },
+]
+
+export const tabbarStore = reactive({
+ curIdx: 0,
+ setCurIdx(idx: number) {
+ this.curIdx = idx
+ },
+})
diff --git a/src/pages/my/index.vue b/src/pages/my/index.vue
new file mode 100644
index 0000000..ddc1334
--- /dev/null
+++ b/src/pages/my/index.vue
@@ -0,0 +1,20 @@
+
+{
+ layout: 'default',
+ style: {
+ navigationBarTitleText: '我的',
+ },
+}
+
+
+
+ my
+
+
+
+
+
diff --git a/src/store/tabbar.ts b/src/store/tabbar.ts
deleted file mode 100644
index ad1d840..0000000
--- a/src/store/tabbar.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-import { defineStore } from 'pinia'
-import { ref } from 'vue'
-
-export const useTabbarStore = defineStore(
- 'tabbar',
- () => {
- interface tabBarItem {
- iconPath: string
- selectedIconPath: string
- pagePath: string
- text: string
- }
- const tabBarList = ref([
- {
- iconPath: '/static/tabbar/home.png',
- selectedIconPath: '/static/tabbar/homeHL.png',
- pagePath: '/pages/index/index',
- text: '首页',
- },
- {
- iconPath: '/static/tabbar/example.png',
- selectedIconPath: '/static/tabbar/exampleHL.png',
- pagePath: '/pages/index/about',
- text: '关于',
- },
- ])
- const tabIndex = ref(0)
-
- const setTabIndex = (val: number) => {
- tabIndex.value = val
- }
-
- return {
- tabBarList,
- tabIndex,
- setTabIndex,
- }
- },
- {
- persist: true,
- },
-)
diff --git a/src/utils/index.ts b/src/utils/index.ts
index 14ef106..715c123 100644
--- a/src/utils/index.ts
+++ b/src/utils/index.ts
@@ -1,4 +1,3 @@
-// @ts-expect-error import json file
import { pages, subPackages, tabBar } from '@/pages.json'
/** 判断当前页面是否是tabbar页 */