fix(vue): correct views are now unmounted in tabs (#25270)

resolves #25255
This commit is contained in:
Liam DeBeasi
2022-05-18 10:10:02 -04:00
committed by GitHub
parent ba0f8caba8
commit 5e23fb1ce4
3 changed files with 71 additions and 4 deletions

View File

@ -9,6 +9,15 @@ import { shallowRef } from 'vue';
export const createViewStacks = (router: Router) => {
let viewStacks: ViewStacks = {};
/**
* Returns the number of active stacks.
* This is useful for determining if an app
* is using linear navigation only or non-linear
* navigation. Multiple stacks indiciate an app
* is using non-linear navigation.
*/
const size = () => Object.keys(viewStacks).length;
const clear = (outletId: number) => {
delete viewStacks[outletId];
}
@ -211,6 +220,7 @@ export const createViewStacks = (router: Router) => {
add,
remove,
registerIonPage,
getViewStack
getViewStack,
size
}
}