File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed
Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ declare type RouteConfig = {
3737 children ?: Array < RouteConfig > ;
3838 beforeEnter ? : NavigationGuard ;
3939 meta ? : any ;
40+ props ? : boolean | Object | Function ;
4041}
4142
4243declare type RouteRecord = {
@@ -49,6 +50,7 @@ declare type RouteRecord = {
4950 matchAs: ?string ;
5051 beforeEnter: ?NavigationGuard ;
5152 meta: any ;
53+ props: boolean | Object | Function | Dictionary < boolean | Object | Function > ;
5254}
5355
5456declare type Location = {
Original file line number Diff line number Diff line change @@ -44,10 +44,14 @@ function addRouteRecord (
4444 name ,
4545 parent ,
4646 matchAs ,
47- props : typeof route . props === 'undefined' ? { } : ( route . components ? route . props : { default : route . props } ) ,
4847 redirect : route . redirect ,
4948 beforeEnter : route . beforeEnter ,
50- meta: route . meta || { }
49+ meta : route . meta || { } ,
50+ props : route . props == null
51+ ? { }
52+ : route . components
53+ ? route . props
54+ : { default : route . props }
5155 }
5256
5357 if ( route . children ) {
Original file line number Diff line number Diff line change @@ -59,6 +59,7 @@ export interface RouteConfig {
5959 children ?: RouteConfig [ ] ;
6060 meta ?: any ;
6161 beforeEnter ?: NavigationGuard ;
62+ props ?: boolean | Object | Function ;
6263}
6364
6465export interface RouteRecord {
@@ -75,6 +76,7 @@ export interface RouteRecord {
7576 redirect : ( location : RawLocation ) => void ,
7677 next : ( ) => void
7778 ) => any ;
79+ props : boolean | Object | Function | Dictionary < boolean | Object | Function > ;
7880}
7981
8082export interface Location {
You can’t perform that action at this time.
0 commit comments