fix(vue): correctly handle query params (#22253)

resolves #22229
This commit is contained in:
Liam DeBeasi
2020-10-06 14:12:40 -04:00
committed by GitHub
parent f5d657c6cd
commit 6849dd3483
8 changed files with 90 additions and 211 deletions

View File

@ -219,13 +219,13 @@ export const createIonRouter = (opts: IonicVueRouterOptions, router: Router) =>
const changeTab = (tab: string, path: string) => {
const routeInfo = locationHistory.getCurrentRouteInfoForTab(tab);
// TODO search
const [pathname] = path.split('?');
if (routeInfo) {
incomingRouteParams = Object.assign(Object.assign({}, routeInfo), { routerAction: 'push', routerDirection: 'none' });
router.push(routeInfo.pathname + (routeInfo.search || ''));
const search = (routeInfo.search) ? `?${routeInfo.search}` : '';
router.push(routeInfo.pathname + search);
}
else {
handleNavigate(pathname, 'push', 'none', undefined, tab);