From 9a34868fb75dfd4072fe8d85249469fc1fc08038 Mon Sep 17 00:00:00 2001 From: feige996 <1020102647@qq.com> Date: Fri, 20 Jun 2025 19:32:34 +0800 Subject: [PATCH] =?UTF-8?q?refactor(tabbar):=20=E5=B0=86tabbar=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=8A=BD=E7=A6=BB=E4=B8=BA=E5=8D=95=E7=8B=AC=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E4=BB=A5=E6=8F=90=E9=AB=98=E5=8F=AF=E7=BB=B4=E6=8A=A4?= =?UTF-8?q?=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将pages.config.ts中的tabbar配置抽离到单独的tabbarList.ts文件 移除pages.json中无用的__esModule字段 --- pages.config.ts | 29 ++------------------------ src/components/fg-tabbar/tabbarList.ts | 27 ++++++++++++++++++++++++ src/pages.json | 1 - 3 files changed, 29 insertions(+), 28 deletions(-) create mode 100644 src/components/fg-tabbar/tabbarList.ts diff --git a/pages.config.ts b/pages.config.ts index e36fc30..8e98f1d 100644 --- a/pages.config.ts +++ b/pages.config.ts @@ -1,4 +1,5 @@ import { defineUniPages } from '@uni-helper/vite-plugin-uni-pages' +import tabbarList from './src/components/fg-tabbar/tabbarList' export default defineUniPages({ globalStyle: { @@ -28,32 +29,6 @@ export default defineUniPages({ fontSize: '10px', iconWidth: '24px', spacing: '3px', - list: [ - // 注意tabbar路由需要使用 layout:tabbar 布局 - { - pagePath: 'pages/index/index', - text: '首页', - icon: 'home', - iconType: 'wot', - }, - { - pagePath: 'pages/about/about', - text: '关于', - icon: 'i-carbon-code', - iconType: 'unocss', - }, - // { - // pagePath: 'pages/my/index', - // text: '我的', - // icon: '/static/logo.svg', - // iconType: 'local', - // }, - // { - // pagePath: 'pages/mine/index', - // text: '我的', - // icon: 'iconfont icon-my', - // iconType: 'iconfont', - // }, - ], + list: tabbarList as any, }, }) diff --git a/src/components/fg-tabbar/tabbarList.ts b/src/components/fg-tabbar/tabbarList.ts new file mode 100644 index 0000000..d4f7b90 --- /dev/null +++ b/src/components/fg-tabbar/tabbarList.ts @@ -0,0 +1,27 @@ +export default [ + // 注意tabbar路由需要使用 layout:tabbar 布局 + { + pagePath: 'pages/index/index', + text: '首页', + icon: 'home', + iconType: 'wot', + }, + { + pagePath: 'pages/about/about', + text: '关于', + icon: 'i-carbon-code', + iconType: 'unocss', + }, + // { + // pagePath: 'pages/my/index', + // text: '我的', + // icon: '/static/logo.svg', + // iconType: 'local', + // }, + // { + // pagePath: 'pages/mine/index', + // text: '我的', + // icon: 'iconfont icon-my', + // iconType: 'iconfont', + // }, +] diff --git a/src/pages.json b/src/pages.json index 7f469db..a3ceb1c 100644 --- a/src/pages.json +++ b/src/pages.json @@ -39,7 +39,6 @@ } ] }, - "__esModule": true, "pages": [ { "path": "pages/index/index",