File tree 2 files changed +6
-4
lines changed 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ export default function (Vue) {
77
77
this . updateClasses ( this . vm . $route . path )
78
78
let isAbsolute = path . charAt ( 0 ) === '/'
79
79
// do not format non-hash relative paths
80
- let href = router . mode === 'hash' || isAbsolute
80
+ let href = path && ( router . mode === 'hash' || isAbsolute )
81
81
? router . history . formatPath ( path , append )
82
82
: path
83
83
if ( this . el . tagName === 'A' ) {
Original file line number Diff line number Diff line change @@ -200,7 +200,9 @@ class Router {
200
200
append = path . append
201
201
}
202
202
path = this . _stringifyPath ( path )
203
- this . history . go ( path , replace , append )
203
+ if ( path ) {
204
+ this . history . go ( path , replace , append )
205
+ }
204
206
}
205
207
206
208
/**
@@ -505,7 +507,7 @@ class Router {
505
507
*/
506
508
507
509
_stringifyPath ( path ) {
508
- if ( typeof path === 'object' ) {
510
+ if ( path && typeof path === 'object' ) {
509
511
if ( path . name ) {
510
512
var params = path . params || { }
511
513
if ( path . query ) {
@@ -518,7 +520,7 @@ class Router {
518
520
return ''
519
521
}
520
522
} else {
521
- return path + ''
523
+ return path ? path + '' : ''
522
524
}
523
525
}
524
526
}
You can’t perform that action at this time.
0 commit comments