diff --git a/pages.config.ts b/pages.config.ts
index 0748717..d578e81 100644
--- a/pages.config.ts
+++ b/pages.config.ts
@@ -35,7 +35,7 @@ export default defineUniPages({
iconType: 'wot',
},
{
- pagePath: 'pages/index/about',
+ pagePath: 'pages/about/about',
text: '关于',
icon: 'i-carbon-code',
iconType: 'unocss',
diff --git a/src/components/fg-tabbar/fg-tabbar.vue b/src/components/fg-tabbar/fg-tabbar.vue
index de65199..d226edc 100644
--- a/src/components/fg-tabbar/fg-tabbar.vue
+++ b/src/components/fg-tabbar/fg-tabbar.vue
@@ -40,7 +40,7 @@
import { tabBar } from '@/pages.json'
import { tabbarStore } from './tabbar'
-/** tabbarList 里面的 path 必须和 pages.config.ts 的页面路径一致 */
+/** tabbarList 里面的 path 从 pages.config.ts 得到 */
const tabbarList = tabBar.list.map((item) => ({ ...item, path: `/${item.pagePath}` }))
function selectTabBar({ value: index }: { value: number }) {
diff --git a/src/components/fg-tabbar/tabbar.ts b/src/components/fg-tabbar/tabbar.ts
index c491eba..03be03f 100644
--- a/src/components/fg-tabbar/tabbar.ts
+++ b/src/components/fg-tabbar/tabbar.ts
@@ -1,20 +1,6 @@
-export const tabbarList = [
- {
- path: '/pages/index/about',
- icon: 'home',
- isWotIcon: true,
- title: '首页',
- },
- {
- path: '/pages/index/index',
- icon: 'i-carbon-user-avatar',
- isWotIcon: false,
- title: '我的',
- },
-]
-
/**
* tabbar 状态,增加 storageSync 保证刷新浏览器时在正确的 tabbar 页面
+ * 使用reactive简单状态,而不是 pinia 全局状态
*/
export const tabbarStore = reactive({
curIdx: uni.getStorageSync('app-tabbar-index') || 0,
diff --git a/src/layouts/tabbar.vue b/src/layouts/tabbar.vue
index a63127d..df03b91 100644
--- a/src/layouts/tabbar.vue
+++ b/src/layouts/tabbar.vue
@@ -1,4 +1,19 @@
-
-
+
+
+
+
+
+
+
+
+
diff --git a/src/pages.json b/src/pages.json
index 9698203..566d79a 100644
--- a/src/pages.json
+++ b/src/pages.json
@@ -31,7 +31,7 @@
"iconType": "wot"
},
{
- "pagePath": "pages/index/about",
+ "pagePath": "pages/about/about",
"text": "关于",
"icon": "i-carbon-code",
"iconType": "unocss"
@@ -57,13 +57,7 @@
{
"path": "pages/about/about",
"type": "page",
- "style": {
- "navigationBarTitleText": "关于"
- }
- },
- {
- "path": "pages/index/about",
- "type": "page",
+ "layout": "tabbar",
"style": {
"navigationBarTitleText": "关于"
}
diff --git a/src/pages/about/about.vue b/src/pages/about/about.vue
index 2ba2e3c..8981478 100644
--- a/src/pages/about/about.vue
+++ b/src/pages/about/about.vue
@@ -1,5 +1,6 @@
{
+ layout: 'tabbar',
style: {
navigationBarTitleText: '关于',
},
diff --git a/src/pages/index/about.vue b/src/pages/index/about.vue
deleted file mode 100644
index 1161772..0000000
--- a/src/pages/index/about.vue
+++ /dev/null
@@ -1,60 +0,0 @@
-
-{
- style: {
- navigationBarTitleText: '关于',
- },
-}
-
-
-
-
- 关于页面
-
- 鸽友们好,我是
- 菲鸽
-
-
- 去请求页
-
- 去请求页2 (状态一体)
-
-
-
-
- 上传demo
-
- 上传demo2(状态一体)
-
-
-
- iconfont:
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/types/uni-pages.d.ts b/src/types/uni-pages.d.ts
index 1964130..f73e4a9 100644
--- a/src/types/uni-pages.d.ts
+++ b/src/types/uni-pages.d.ts
@@ -6,13 +6,12 @@
interface NavigateToOptions {
url: "/pages/index/index" |
"/pages/about/about" |
- "/pages/index/about" |
"/pages/my/index";
}
interface RedirectToOptions extends NavigateToOptions {}
interface SwitchTabOptions {
- url: "/pages/index/index" | "/pages/index/about" | "/pages/my/index"
+ url: "/pages/index/index" | "/pages/about/about" | "/pages/my/index"
}
type ReLaunchOptions = NavigateToOptions | SwitchTabOptions;