fix(vue): pass in correct route to props function (#22605)

resolves #22602
This commit is contained in:
Liam DeBeasi
2020-12-07 10:33:22 -05:00
committed by GitHub
parent 36939e10ae
commit 01afdc42e5
4 changed files with 69 additions and 19 deletions

View File

@ -2,6 +2,14 @@ import { AnimationBuilder } from '@ionic/core';
import { RouteLocationMatched, RouterOptions } from 'vue-router';
import { Ref } from 'vue';
export interface VueComponentData {
/**
* The cached result of the props
* function for a particular view instance.
*/
propsFunctionResult?: any;
}
export interface IonicVueRouterOptions extends RouterOptions {
tabsPrefix?: string;
}
@ -43,6 +51,7 @@ export interface ViewItem {
registerCallback?: () => void;
vueComponentRef: Ref;
params?: { [k: string]: any };
vueComponentData: VueComponentData;
}
export interface ViewStacks {

View File

@ -89,7 +89,8 @@ export const createViewStacks = () => {
ionRoute: false,
mount: false,
exact: routeInfo.pathname === matchedRoute.path,
params: routeInfo.params
params: routeInfo.params,
vueComponentData: {}
};
}