Skip to content

Commit c1df447

Browse files
committed
fix(types): missing children
Close #3230
1 parent 0eaae3a commit c1df447

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

types/router.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ export interface PathToRegexpOptions {
9292
interface _RouteConfigBase {
9393
path: string
9494
name?: string
95+
children?: RouteConfig[]
9596
redirect?: RedirectOption
9697
alias?: string | string[]
9798
meta?: any
@@ -107,7 +108,6 @@ interface RouteConfigSingleView extends _RouteConfigBase {
107108

108109
interface RouteConfigMultipleViews extends _RouteConfigBase {
109110
components?: Dictionary<Component>
110-
children?: RouteConfig[]
111111
props?: Dictionary<boolean | Object | RoutePropsFunction>
112112
}
113113

types/test/index.ts

+10
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,16 @@ const router = new VueRouter({
6767
})
6868
},
6969
routes: [
70+
{
71+
path: '/foo',
72+
component: Home,
73+
children: [{ path: '', component: Home }]
74+
},
75+
{
76+
path: '/foo',
77+
components: { default: Home },
78+
children: [{ path: '', component: Home }]
79+
},
7080
{
7181
path: '/',
7282
name: 'home',

0 commit comments

Comments
 (0)