mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-16 10:01:59 +08:00
fix(react, vue): tab buttons no longer throw an error if href is undefined (#22998)
resolves #22997
This commit is contained in:
@ -76,7 +76,9 @@ class IonRouterInner extends React.PureComponent<IonRouteProps, IonRouteState> {
|
||||
};
|
||||
}
|
||||
|
||||
handleChangeTab(tab: string, path: string, routeOptions?: any) {
|
||||
handleChangeTab(tab: string, path?: string, routeOptions?: any) {
|
||||
if (!path) { return; }
|
||||
|
||||
const routeInfo = this.locationHistory.getCurrentRouteInfoForTab(tab);
|
||||
const [pathname, search] = path.split('?');
|
||||
if (routeInfo) {
|
||||
|
@ -252,7 +252,9 @@ export const createIonRouter = (opts: IonicVueRouterOptions, router: Router) =>
|
||||
}
|
||||
}
|
||||
|
||||
const changeTab = (tab: string, path: string) => {
|
||||
const changeTab = (tab: string, path?: string) => {
|
||||
if (!path) return;
|
||||
|
||||
const routeInfo = locationHistory.getCurrentRouteInfoForTab(tab);
|
||||
const [pathname] = path.split('?');
|
||||
|
||||
|
Reference in New Issue
Block a user