mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
fix(vue): ion-tab-bar no longer throws undefined error when re-creating tabs (#22261)
resolves #22255
This commit is contained in:
@ -9,10 +9,10 @@ export const IonTabBar = defineComponent({
|
||||
// TODO types
|
||||
const tabs = Array.from(this.$el.querySelectorAll('ion-tab-button')) as any[];
|
||||
const activeTab = tabs.find(tab => currentRoute.pathname.startsWith(tab.href));
|
||||
const tabBar = this.$refs.ionTabBar;
|
||||
|
||||
if (activeTab) {
|
||||
if (activeTab && tabBar) {
|
||||
ionRouter.handleSetCurrentTab(activeTab.tab);
|
||||
const tabBar = this.$refs.ionTabBar;
|
||||
tabBar.selectedTab = activeTab.tab;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user