refactor: 移除tabbar相关配置和逻辑

- 删除pages.config.ts和pages.json中的tabBar配置
- 移除default.vue中与tabbar相关的逻辑代码
- 更新类型声明文件中的SwitchTabOptions接口
- 添加Tabbar组件到全局组件声明
```

这个提交消息:
1. 使用了`refactor`类型,因为这是代码重构,不改变功能但优化了代码结构
2. 简洁地描述了主要变更内容
3. 在消息体中列出了具体的修改点
4. 使用了中文并保持简洁明了
5. 遵循了50字符限制和祈使语气的要求
This commit is contained in:
feige996 2025-05-26 23:40:38 +08:00
parent f91fff8004
commit cfced2e6d8
5 changed files with 2 additions and 56 deletions

View File

@ -18,28 +18,4 @@ export default defineUniPages({
},
},
// 如果不需要tabBar可以注释掉这个配置或者直接删除
tabBar: {
color: '#999999',
selectedColor: '#018d71',
backgroundColor: '#F8F8F8',
borderStyle: 'black',
height: '50px',
fontSize: '10px',
iconWidth: '24px',
spacing: '3px',
list: [
{
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/about/about',
text: '关于',
},
],
},
})

View File

@ -7,15 +7,8 @@
</template>
<script lang="ts" setup>
import { getIsTabbar } from '@/utils'
import type { ConfigProviderThemeVars } from 'wot-design-uni'
onMounted(() => {
if (getIsTabbar()) {
uni.hideTabBar()
}
})
const themeVars: ConfigProviderThemeVars = {
// colorTheme: 'red',
// buttonPrimaryBgColor: '#07c160',

View File

@ -14,30 +14,6 @@
"^(?!z-paging-refresh|z-paging-load-more)z-paging(.*)": "z-paging/components/z-paging$1/z-paging$1.vue"
}
},
"tabBar": {
"color": "#999999",
"selectedColor": "#018d71",
"backgroundColor": "#F8F8F8",
"borderStyle": "black",
"height": "50px",
"fontSize": "10px",
"iconWidth": "24px",
"spacing": "3px",
"list": [
{
"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/about/about",
"text": "关于"
}
]
},
"pages": [
{
"path": "pages/index/index",

View File

@ -8,5 +8,6 @@ export {}
declare module 'vue' {
export interface GlobalComponents {
FgNavbar: typeof import('./../components/fg-navbar/fg-navbar.vue')['default']
Tabbar: typeof import('./../components/tabbar/tabbar.vue')['default']
}
}

View File

@ -10,7 +10,7 @@ interface NavigateToOptions {
interface RedirectToOptions extends NavigateToOptions {}
interface SwitchTabOptions {
url: "/pages/index/index" | "/pages/about/about"
}
type ReLaunchOptions = NavigateToOptions | SwitchTabOptions;