File tree 2 files changed +6
-2
lines changed
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ function warn (msg) {
14
14
}
15
15
}
16
16
17
- function tryDecode ( uri , asComponent ) {
17
+ export function tryDecode ( uri , asComponent ) {
18
18
try {
19
19
return asComponent
20
20
? decodeURIComponent ( uri )
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import {
13
13
canReuse
14
14
} from './pipeline'
15
15
16
+ import { tryDecode } from '../lib/route-recognizer'
16
17
/**
17
18
* A RouteTransition object manages the pipeline of a
18
19
* router-view switching process. This is also the object
@@ -45,7 +46,10 @@ export default class RouteTransition {
45
46
// on initial load, it gets caught in an infinite loop.
46
47
const abortingOnLoad = ! this . from . path && this . to . path === '/'
47
48
if ( ! abortingOnLoad ) {
48
- this . router . replace ( this . from . path || '/' )
49
+ // When aborting, we have to decode the Path, because router.replace()
50
+ // will encode it again. (https://github.com/vuejs/vue-router/issues/760)
51
+ const path = this . from . path ? tryDecode ( this . from . path , true ) : '/'
52
+ this . router . replace ( path )
49
53
}
50
54
}
51
55
}
You can’t perform that action at this time.
0 commit comments