mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
fix(vue): correctly remove old view when replacing route (#22566)
resolves #22492
This commit is contained in:
@ -238,7 +238,11 @@ export const IonRouterOutlet = defineComponent({
|
||||
leavingEl.classList.add('ion-page-hidden');
|
||||
leavingEl.setAttribute('aria-hidden', 'true');
|
||||
|
||||
if (!(routerAction === 'push' && routerDirection === 'forward')) {
|
||||
if (routerAction === 'replace') {
|
||||
leavingViewItem.mount = false;
|
||||
leavingViewItem.ionPageElement = undefined;
|
||||
leavingViewItem.ionRoute = false;
|
||||
} else if (!(routerAction === 'push' && routerDirection === 'forward')) {
|
||||
const shouldLeavingViewBeRemoved = routerDirection !== 'none' && leavingViewItem && (enteringViewItem !== leavingViewItem);
|
||||
if (shouldLeavingViewBeRemoved) {
|
||||
leavingViewItem.mount = false;
|
||||
|
Reference in New Issue
Block a user