马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
1. 修改设置
- "tabBar": {
- "custom": true,
- "selectedColor": "#ffdead",
- "list": [{
- "pagePath": "pages/index/index",
- "text": "首页"
- }]
- },
复制代码- //在引入自定义Tabbar组件的时候在载入的时候手动注释一下
- import {
- onLoad
- } from '@dcloudio/uni-app'
- onLoad(() => {
- uni.hideTabBar();
- })
- //切记app.vue里面也要写一下
- onLaunch: function() {
- console.log('App Launch')
- uni.hideTabBar()
- uni.removeStorageSync('selectedIndex')
- },
复制代码 2. 引入组件
- //这里跳转的最好是在tabbar的基础上加上根路径要不然是相对地址会错
- const tabBarChange = (url) => {
- uni.switchTab({
- url: url
- })
- }
复制代码 |