File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 5
5
isRouteName ,
6
6
RouteRecordName ,
7
7
_RouteRecordProps ,
8
- RouteRecordRedirect ,
9
8
} from '../types'
10
9
import { createRouterError , ErrorTypes , MatcherError } from '../errors'
11
10
import { createRouteRecordMatcher , RouteRecordMatcher } from './pathMatcher'
@@ -375,8 +374,7 @@ function normalizeRecordProps(
375
374
) : Record < string , _RouteRecordProps > {
376
375
const propsObject = { } as Record < string , _RouteRecordProps >
377
376
// props does not exist on redirect records but we can set false directly
378
- const props =
379
- ( record as Exclude < RouteRecordRaw , RouteRecordRedirect > ) . props || false
377
+ const props = record . props || false
380
378
if ( 'component' in record ) {
381
379
propsObject . default = props
382
380
} else {
Original file line number Diff line number Diff line change @@ -267,6 +267,11 @@ export interface _RouteRecordBase extends PathParserOptions {
267
267
* Array of nested routes.
268
268
*/
269
269
children ?: RouteRecordRaw [ ]
270
+
271
+ /**
272
+ * Allow passing down params as props to the component rendered by `router-view`.
273
+ */
274
+ props ?: _RouteRecordProps | Record < string , _RouteRecordProps >
270
275
}
271
276
272
277
/**
@@ -379,6 +384,7 @@ export interface RouteRecordRedirect extends _RouteRecordBase {
379
384
redirect : RouteRecordRedirectOption
380
385
component ?: never
381
386
components ?: never
387
+ props ?: never
382
388
}
383
389
384
390
export type RouteRecordRaw =
You can’t perform that action at this time.
0 commit comments