File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -158,9 +158,11 @@ export default class VueRouter {
158158 this . go ( 1 )
159159 }
160160
161- getMatchedComponents ( to ? : RawLocation ) : Array < any > {
162- const route = to
163- ? this . resolve ( to ) . route
161+ getMatchedComponents ( to ? : RawLocation | Route ) : Array < any > {
162+ const route : any = to
163+ ? to . matched
164+ ? to
165+ : this . resolve ( to ) . route
164166 : this . currentRoute
165167 if ( ! route ) {
166168 return [ ]
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ declare class VueRouter {
2828 go ( n : number ) : void ;
2929 back ( ) : void ;
3030 forward ( ) : void ;
31- getMatchedComponents ( to ?: RawLocation ) : Component [ ] ;
31+ getMatchedComponents ( to ?: RawLocation | Route ) : Component [ ] ;
3232 onReady ( cb : Function , errorCb ?: Function ) : void ;
3333 onError ( cb : Function ) : void ;
3434 addRoutes ( routes : RouteConfig [ ] ) : void ;
You can’t perform that action at this time.
0 commit comments