Skip to content

Commit d53ec3c

Browse files
committed
support replace: true in route guards next() (close #897)
1 parent 1e9171f commit d53ec3c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: src/history/base.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export class History {
7373
this.ensureURL(true)
7474
} else if (typeof to === 'string' || typeof to === 'object') {
7575
// next('/') or next({ path: '/' }) -> redirect
76-
this.push(to)
76+
(typeof to === 'object' && to.replace) ? this.replace(to) : this.push(to)
7777
} else {
7878
// confirm transition and pass on the value
7979
next(to)

0 commit comments

Comments
 (0)