File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -267,7 +267,7 @@ class Router {
267
267
*/
268
268
269
269
_addRoute ( path , handler , segments ) {
270
- guardComponent ( handler )
270
+ guardComponent ( path , handler )
271
271
segments . push ( {
272
272
path : path ,
273
273
handler : handler
@@ -297,7 +297,7 @@ class Router {
297
297
*/
298
298
299
299
_notFound ( handler ) {
300
- guardComponent ( handler )
300
+ guardComponent ( '*' , handler )
301
301
this . _notFoundHandler = [ { handler : handler } ]
302
302
}
303
303
@@ -523,10 +523,11 @@ class Router {
523
523
* Allow directly passing components to a route
524
524
* definition.
525
525
*
526
+ * @param {String } path
526
527
* @param {Object } handler
527
528
*/
528
529
529
- function guardComponent ( handler ) {
530
+ function guardComponent ( path , handler ) {
530
531
let comp = handler . component
531
532
if ( Vue . util . isPlainObject ( comp ) ) {
532
533
comp = handler . component = Vue . extend ( comp )
@@ -535,7 +536,7 @@ function guardComponent (handler) {
535
536
if ( typeof comp !== 'function' ) {
536
537
handler . component = null
537
538
warn (
538
- 'invalid component for route "' + handler . path + '"'
539
+ 'invalid component for route "' + path + '". '
539
540
)
540
541
}
541
542
}
You can’t perform that action at this time.
0 commit comments