fix(vue): correctly determine leaving view when transitioning to a new instance of a previous page (#22655)

resolves #22654 resolves #22658
This commit is contained in:
Liam DeBeasi
2020-12-16 16:45:28 -05:00
committed by GitHub
parent 5c27dd8032
commit e3a05bfeb5
19 changed files with 290 additions and 693 deletions

View File

@ -188,6 +188,7 @@ export const createIonRouter = (opts: IonicVueRouterOptions, router: Router) =>
pathname: location.path,
search: location.fullPath && location.fullPath.split('?')[1] || '',
params: location.params && location.params,
prevRouteLastPathname: leavingLocationInfo.lastPathname
}
if (isPushed) {
@ -205,6 +206,7 @@ export const createIonRouter = (opts: IonicVueRouterOptions, router: Router) =>
routeInfo.pushedByRoute = currentRouteInfo?.pushedByRoute || routeInfo.pushedByRoute;
routeInfo.routerDirection = currentRouteInfo?.routerDirection || routeInfo.routerDirection;
routeInfo.routerAnimation = currentRouteInfo?.routerAnimation || routeInfo.routerAnimation;
routeInfo.prevRouteLastPathname = currentRouteInfo?.lastPathname;
}
locationHistory.add(routeInfo);