File tree 2 files changed +16
-1
lines changed
2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ export interface PathToRegexpOptions {
89
89
end ?: boolean
90
90
}
91
91
92
- export interface RouteConfig {
92
+ interface _RouteConfigBase {
93
93
path : string
94
94
name ?: string
95
95
component ?: Component
@@ -104,6 +104,18 @@ export interface RouteConfig {
104
104
pathToRegexpOptions ?: PathToRegexpOptions
105
105
}
106
106
107
+ type RouteConfigSingleView = _RouteConfigBase | {
108
+ component ?: Component
109
+ props ?: boolean | Object | RoutePropsFunction
110
+ }
111
+
112
+ type RouteConfigMultipleViews = _RouteConfigBase | {
113
+ components ?: Dictionary < Component >
114
+ props ?: Dictionary < boolean | Object | RoutePropsFunction >
115
+ }
116
+
117
+ export type RouteConfig = RouteConfigSingleView | RouteConfigMultipleViews
118
+
107
119
export interface RouteRecord {
108
120
path : string
109
121
regex : RegExp
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ Vue.use(VueRouter)
8
8
const Home = { template : '<div>home</div>' }
9
9
const Foo = { template : '<div>foo</div>' }
10
10
const Bar = { template : '<div>bar</div>' }
11
+ const Abc = { template : '<div>abc</div>' }
11
12
const Async = ( ) => Promise . resolve ( { template : '<div>async</div>' } )
12
13
13
14
const Hook : ComponentOptions < Vue > = {
@@ -76,6 +77,7 @@ const router = new VueRouter({
76
77
components : {
77
78
default : Foo ,
78
79
bar : Bar ,
80
+ abc : Abc ,
79
81
asyncComponent : Async
80
82
} ,
81
83
meta : { auth : true } ,
@@ -88,6 +90,7 @@ const router = new VueRouter({
88
90
props : {
89
91
default : true ,
90
92
bar : { id : 123 } ,
93
+ abc : route => route . params ,
91
94
asyncComponent : ( route : Route ) => route . params
92
95
}
93
96
} ,
You can’t perform that action at this time.
0 commit comments