tabbar选中优化

This commit is contained in:
Dev
2026-10-19 16:15:03 +08:00
parent 6beeeb2383
commit d34cab0145
2 changed files with 13 additions and 0 deletions
@@ -179,6 +179,14 @@ Page({
this.loadGoodsList(true);
},
onShow() {
// 自定义 tabBar 每个 Tab 页各有一份实例,切过来后要按当前路由重设选中项
const tabBar = typeof this.getTabBar === 'function' && this.getTabBar();
if (tabBar) {
tabBar.init();
}
},
async applyCaseView() {
if (this.data.caseView) {
wx.setNavigationBarTitle({ title: '软件案例' });
@@ -154,6 +154,11 @@ Page({
},
onShow() {
// 自定义 tabBar 每个 Tab 页各有一份实例,切过来后要按当前路由重设选中项
const tabBar = typeof this.getTabBar === 'function' && this.getTabBar();
if (tabBar) {
tabBar.init();
}
this.loadList(true);
},