|
1 |
| -import Vue, { ComponentOptions, AsyncComponent } from 'vue' |
| 1 | +import Vue, { ComponentOptions, AsyncComponent, Component } from 'vue' |
2 | 2 |
|
3 | 3 | import VueRouter from '../index'
|
4 | 4 | import {
|
@@ -54,6 +54,11 @@ const Hook: ComponentOptions<Vue> = {
|
54 | 54 | }
|
55 | 55 | }
|
56 | 56 |
|
| 57 | +const JSXComponent = () => { |
| 58 | + $props: { |
| 59 | + } |
| 60 | +} |
| 61 | + |
57 | 62 | const router = new VueRouter({
|
58 | 63 | mode: 'history',
|
59 | 64 | base: '/',
|
@@ -104,7 +109,8 @@ const router = new VueRouter({
|
104 | 109 | default: Foo,
|
105 | 110 | bar: Bar,
|
106 | 111 | abc: Abc,
|
107 |
| - asyncComponent: Async |
| 112 | + asyncComponent: Async, |
| 113 | + JSXComponent |
108 | 114 | },
|
109 | 115 | meta: { auth: true, nested: { foo: '' } },
|
110 | 116 | beforeEnter(to, from, next) {
|
@@ -154,7 +160,7 @@ const matched: RouteRecord[] = route.matched
|
154 | 160 | matched.forEach(m => {
|
155 | 161 | const path: string = m.path
|
156 | 162 | const components: {
|
157 |
| - [key: string]: ComponentOptions<Vue> | typeof Vue | AsyncComponent |
| 163 | + [key: string]: Component | AsyncComponent | {} |
158 | 164 | } = m.components
|
159 | 165 | const instances: { [key: string]: Vue } = m.instances
|
160 | 166 | const name: string | undefined | null = m.name
|
@@ -226,9 +232,9 @@ router.back()
|
226 | 232 | router.forward()
|
227 | 233 |
|
228 | 234 | const Components: (
|
229 |
| - | ComponentOptions<Vue> |
230 |
| - | typeof Vue |
| 235 | + | Component |
231 | 236 | | AsyncComponent
|
| 237 | + | {} |
232 | 238 | )[] = router.getMatchedComponents()
|
233 | 239 |
|
234 | 240 | const match: Route = router.match('/more')
|
|
0 commit comments