更新记录
1.0.3(2026-05-26)
优化
1.0.2(2026-04-17)
将小程序端需自定义tabbar单独抽取到mp-tab-renderer.uvue文件里
1.0.1(2026-04-16)
1:更新自定义tabbar标题栏样式动态设置
查看更多平台兼容性
uni-app
| Vue2 | Vue3 | Chrome | Safari | app-vue | app-nvue | Android | iOS | 鸿蒙 |
|---|---|---|---|---|---|---|---|---|
| - | √ | √ | √ | √ | √ | √ | √ | √ |
| 微信小程序 | 支付宝小程序 | 抖音小程序 | 百度小程序 | 快手小程序 | 京东小程序 | 鸿蒙元服务 | QQ小程序 | 飞书小程序 | 小红书小程序 | 快应用-华为 | 快应用-联盟 |
|---|---|---|---|---|---|---|---|---|---|---|---|
| √ | - | - | - | - | - | - | - | - | - | - | - |
uni-app x(4.0)
| Chrome | Safari | Android | iOS | 鸿蒙 | 微信小程序 |
|---|---|---|---|---|---|
| √ | √ | √ | √ | √ | √ |
配置项说明:
1:项目根目录必须配置 tabbar-config.uts 文件,示例内容如下:
//导入所有自定义tabbar 并注册 import Recommend from '@/pages/home/recommend.uvue' import Order from '@/pages/order/order.uvue' import Mine from '@/pages/mine/mine.uvue' import { setNavbarConfig, NavBarConfig, registerGlobalComponent, setDefaultTabItems, TabItem } from '@/uni_modules/sunrains-tabbar/types.uts'
//注册组件 registerGlobalComponent('home', Recommend) registerGlobalComponent('order', Order) registerGlobalComponent('mine', Mine)
// 2. 配置导航栏(不设置会使用默认配置) setNavbarConfig(new NavBarConfig(true, 17, 'bold', '#333333', '#ffffff', '', 56, 44))
// 3. 设置默认 Tab 列表(至少设置一个固定的,也可以全部设置,其它可通过请求服务端接口动态配置) setDefaultTabItems([ new TabItem('home', '首页', '/static/tab/main1.png', '/static/tab/main1_active.png', '@/pages/home/recommend.uvue', Recommend), new TabItem('mine', '我的', '/static/tab/main3.png', '/static/tab/main3_active.png', '@/pages/mine/mine.uvue', Mine) ])
2:pages.json配置
第一个固定写 { "path": "uni_modules/sunrains-tabbar/index", "style": { "navigationBarTitleText": "自定义tabbar", "navigationStyle": "custom" }
示例如下: { "pages": [ { "path": "uni_modules/sunrains-tabbar/index", "style": { "navigationBarTitleText": "自定义tabbar", "navigationStyle": "custom" } }, { "path": "pages/home/recommend", "style": { "navigationBarTitleText": "首页" } }, { "path": "pages/mine/mine", "style": { "navigationBarTitleText": "我的" } }, { "path": "pages/order/order", "style": { "navigationBarTitleText": "订单" } }, { "path": "pages/detail/detail", "style": { "navigationBarTitleText": "xiangqing" } } ], "globalStyle": { "backgroundColor": "#ffffff" } }

收藏人数:
购买源码授权版(
试用
赞赏(0)
下载 16
赞赏 0
下载 12100721
赞赏 1918
赞赏
京公网安备:11010802035340号