fix(vue): onBeforeRouteLeave and onBeforeRouteUpdate hooks now fire properly (#22542)

resolves #22540
This commit is contained in:
Liam DeBeasi
2020-11-23 10:22:03 -05:00
committed by GitHub
parent 04b874e32a
commit 8002114e72
6 changed files with 6729 additions and 5192 deletions

View File

@ -11,7 +11,7 @@ import {
onUnmounted
} from 'vue';
import { AnimationBuilder, LIFECYCLE_DID_ENTER, LIFECYCLE_DID_LEAVE, LIFECYCLE_WILL_ENTER, LIFECYCLE_WILL_LEAVE } from '@ionic/core';
import { useRoute } from 'vue-router';
import { matchedRouteKey, useRoute } from 'vue-router';
import { fireLifecycle, generateId } from '../utils';
let viewDepthKey: InjectionKey<0> = Symbol(0);
@ -31,6 +31,7 @@ export const IonRouterOutlet = defineComponent({
});
provide(viewDepthKey, depth + 1)
provide(matchedRouteKey, matchedRouteRef);
const ionRouterOutlet = ref();
const id = generateId('ion-router-outlet');