File tree 3 files changed +13
-0
lines changed
3 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,12 @@ export class HashHistory extends History {
55
55
56
56
replace ( location : RawLocation , onComplete ? : Function , onAbort ? : Function ) {
57
57
const { current : fromRoute } = this
58
+ if ( typeof location === 'string' ) {
59
+ location = { path :location }
60
+ }
61
+ if ( typeof location === 'object' && ! location . replace ) {
62
+ location . replace = 1
63
+ }
58
64
this . transitionTo ( location , route => {
59
65
replaceHash ( route . fullPath )
60
66
handleScroll ( this . router , route , fromRoute , false )
Original file line number Diff line number Diff line change @@ -52,6 +52,12 @@ export class HTML5History extends History {
52
52
53
53
replace ( location : RawLocation , onComplete ? : Function , onAbort ? : Function ) {
54
54
const { current : fromRoute } = this
55
+ if ( typeof location === 'string' ) {
56
+ location = { path :location }
57
+ }
58
+ if ( typeof location === 'object' && ! location . replace ) {
59
+ location . replace = 1
60
+ }
55
61
this . transitionTo ( location , route => {
56
62
replaceState ( cleanPath ( this . base + route . fullPath ) )
57
63
handleScroll ( this . router , route , fromRoute , false )
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ export function createRoute (
23
23
meta : ( record && record . meta ) || { } ,
24
24
path : location . path || '/' ,
25
25
hash : location . hash || '' ,
26
+ replace : location . replace || 0 ,
26
27
query,
27
28
params : location . params || { } ,
28
29
fullPath : getFullPath ( location , stringifyQuery ) ,
You can’t perform that action at this time.
0 commit comments