11import Vue = require( "vue" ) ;
2- import { ComponentOptions } from "vue" ;
2+ import { ComponentOptions , AsyncComponent } from "vue" ;
33
44import VueRouter = require( "../index" ) ;
55import { Route , RouteRecord , RedirectOption } from "../index" ;
@@ -9,7 +9,7 @@ Vue.use(VueRouter);
99const Home = { template : "<div>home</div>" } ;
1010const Foo = { template : "<div>foo</div>" } ;
1111const Bar = { template : "<div>bar</div>" } ;
12- const AsyncComponent = ( ) => Promise . resolve ( { template : "<div>async</div>" } )
12+ const Async = ( ) => Promise . resolve ( { template : "<div>async</div>" } )
1313
1414const Hook : ComponentOptions < Vue > = {
1515 template : "<div>hook</div>" ,
@@ -68,7 +68,7 @@ const router = new VueRouter({
6868 components : {
6969 default : Foo ,
7070 bar : Bar ,
71- asyncComponent : AsyncComponent ,
71+ asyncComponent : Async ,
7272 } ,
7373 meta : { auth : true } ,
7474 beforeEnter ( to , from , next ) {
@@ -111,7 +111,7 @@ const matched: RouteRecord[] = route.matched;
111111matched . forEach ( m => {
112112 const path : string = m . path ;
113113 const components : {
114- [ key : string ] : ComponentOptions < Vue > | typeof Vue
114+ [ key : string ] : ComponentOptions < Vue > | typeof Vue | AsyncComponent
115115 } = m . components ;
116116 const instances : { [ key : string ] : Vue } = m . instances ;
117117 const name : string | undefined = m . name ;
@@ -163,7 +163,7 @@ router.go(-1);
163163router . back ( ) ;
164164router . forward ( ) ;
165165
166- const Components : ( ComponentOptions < Vue > | typeof Vue ) [ ] = router . getMatchedComponents ( ) ;
166+ const Components : ( ComponentOptions < Vue > | typeof Vue | AsyncComponent ) [ ] = router . getMatchedComponents ( ) ;
167167
168168const vm = new Vue ( {
169169 router,
0 commit comments