fix(vue): mount correct views when navigating (#24056)

resolves #23914
This commit is contained in:
Liam DeBeasi
2021-10-14 11:28:36 -04:00
committed by GitHub
parent a09d7d4ab6
commit 24659a527a
6 changed files with 125 additions and 39 deletions

View File

@ -214,7 +214,7 @@ export const IonRouterOutlet = defineComponent({
const handlePageTransition = async () => {
const routeInfo = ionRouter.getCurrentRouteInfo();
const { routerDirection, routerAction, routerAnimation, prevRouteLastPathname } = routeInfo;
const { routerDirection, routerAction, routerAnimation, prevRouteLastPathname, delta } = routeInfo;
const enteringViewItem = viewStacks.findViewItemByRouteInfo(routeInfo, id, usingDeprecatedRouteSetup);
let leavingViewItem = viewStacks.findLeavingViewItemByRouteInfo(routeInfo, id, true, usingDeprecatedRouteSetup);
@ -286,10 +286,10 @@ See https://ionicframework.com/docs/vue/navigation#ionpage for more information.
leavingViewItem.mount = false;
leavingViewItem.ionPageElement = undefined;
leavingViewItem.ionRoute = false;
viewStacks.unmountLeavingViews(id, enteringViewItem, leavingViewItem);
viewStacks.unmountLeavingViews(id, enteringViewItem, delta);
}
} else {
viewStacks.mountIntermediaryViews(id, enteringViewItem, leavingViewItem);
viewStacks.mountIntermediaryViews(id, leavingViewItem, delta);
}
fireLifecycle(leavingViewItem.vueComponent, leavingViewItem.vueComponentRef, LIFECYCLE_DID_LEAVE);