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})
}