diff --git a/pages.config.ts b/pages.config.ts index f74e6dc..a24c127 100644 --- a/pages.config.ts +++ b/pages.config.ts @@ -1,5 +1,5 @@ import { defineUniPages } from '@uni-helper/vite-plugin-uni-pages' -import { tabbarList, midButton } from './src/components/fg-tabbar/tabbarList' +import { tabBar } from './src/components/fg-tabbar/tabbarList' export default defineUniPages({ globalStyle: { @@ -18,19 +18,5 @@ export default defineUniPages({ 'z-paging/components/z-paging$1/z-paging$1.vue', }, }, - // 如果不需要tabBar,直接把下面的tabbar删除或者注释掉即可 - tabBar: { - // custom: true, - color: '#999999', - selectedColor: '#018d71', - backgroundColor: '#F8F8F8', - borderStyle: 'black', - height: '50px', - fontSize: '10px', - iconWidth: '24px', - spacing: '3px', - list: tabbarList as any, - // midButton 仅App和H5支持 - midButton: midButton, - }, + tabBar: tabBar as any, }) diff --git a/src/components/fg-tabbar/fg-tabbar.vue b/src/components/fg-tabbar/fg-tabbar.vue index 6737891..a647d27 100644 --- a/src/components/fg-tabbar/fg-tabbar.vue +++ b/src/components/fg-tabbar/fg-tabbar.vue @@ -35,30 +35,31 @@ diff --git a/src/components/fg-tabbar/tabbarList.ts b/src/components/fg-tabbar/tabbarList.ts index 9129e33..cfef7e3 100644 --- a/src/components/fg-tabbar/tabbarList.ts +++ b/src/components/fg-tabbar/tabbarList.ts @@ -31,3 +31,20 @@ export const midButton = { iconPath: '/static/logo.svg', text: '发布', } + +const _tabbar = { + color: '#999999', + selectedColor: '#018d71', + backgroundColor: '#F8F8F8', + borderStyle: 'black', + height: '50px', + fontSize: '10px', + iconWidth: '24px', + spacing: '3px', + list: tabbarList as any, + // midButton 仅App和H5支持 + midButton: midButton, +} + +export const CUSTOM_TABBAR_ENABLE = false +export const tabBar = CUSTOM_TABBAR_ENABLE ? undefined : _tabbar