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 @@ -77,7 +77,7 @@ export default function (Vue) {
7777 this . updateClasses ( this . vm . $route . path )
7878 let isAbsolute = path . charAt ( 0 ) === '/'
7979 // do not format non-hash relative paths
80- let href = router . mode === 'hash' || isAbsolute
80+ let href = path && ( router . mode === 'hash' || isAbsolute )
8181 ? router . history . formatPath ( path , append )
8282 : path
8383 if ( this . el . tagName === 'A' ) {
Original file line number Diff line number Diff line change @@ -200,7 +200,9 @@ class Router {
200200 append = path . append
201201 }
202202 path = this . _stringifyPath ( path )
203- this . history . go ( path , replace , append )
203+ if ( path ) {
204+ this . history . go ( path , replace , append )
205+ }
204206 }
205207
206208 /**
@@ -505,7 +507,7 @@ class Router {
505507 */
506508
507509 _stringifyPath ( path ) {
508- if ( typeof path === 'object' ) {
510+ if ( path && typeof path === 'object' ) {
509511 if ( path . name ) {
510512 var params = path . params || { }
511513 if ( path . query ) {
@@ -518,7 +520,7 @@ class Router {
518520 return ''
519521 }
520522 } else {
521- return path + ''
523+ return path ? path + '' : ''
522524 }
523525 }
524526}
You can’t perform that action at this time.
0 commit comments