fix(vue): lifecycle events are correctly fired in component context (#22348)

resolves #22338
This commit is contained in:
Liam DeBeasi
2020-10-21 11:22:52 -04:00
committed by GitHub
parent 1a2e5322fb
commit bcef804dea
10 changed files with 148 additions and 20 deletions

View File

@ -1,5 +1,6 @@
import { AnimationBuilder } from '@ionic/core';
import { RouteLocationMatched, RouterOptions } from 'vue-router';
import { Ref } from 'vue';
export interface IonicVueRouterOptions extends RouterOptions {
tabsPrefix?: string;
@ -40,6 +41,7 @@ export interface ViewItem {
mount: boolean;
exact: boolean;
registerCallback?: () => void;
vueComponentRef: Ref;
}
export interface ViewStacks {

View File

@ -5,6 +5,7 @@ import { RouteInfo,
ViewStacks,
} from './types';
import { RouteLocationMatched } from 'vue-router';
import { shallowRef } from 'vue';
export const createViewStacks = () => {
let viewStacks: ViewStacks = {};
@ -95,6 +96,7 @@ export const createViewStacks = () => {
matchedRoute,
ionPageElement: ionPage,
vueComponent,
vueComponentRef: shallowRef(),
ionRoute: false,
mount: false,
exact: routeInfo.pathname === matchedRoute.path