tabBarNav(key, path) {
console.log(key)
let tabBarList = getApp().globalData.tabBar[key]
if (!tabBarList) {
console.error('No tabBar data found for key:', key)
return
}
tabBarList.forEach((v, i) => {
console.log('Setting tabBar item at index:', i, v)
uni.setTabBarItem({
index: i, // tabbar索引,第一个为0
pagePath: v.pagePath, // tabbar页面路径
text: v.text,
iconPath: v.iconPath, // tabbar默认图片路径
selectedIconPath: v.selectedIconPath, // tabbar选中后的图片路径
visible: true,
})
})
if (key == 'landlord') {
uni.setTabBarItem({
index: 3,
visible: false,
})
} else {
uni.setTabBarItem({
index: 3,
visible: true,
})
}
uni.switchTab({
url: path,
})
},
1***@qq.com (作者)
这个已经解决了 感谢
2024-11-25 18:09