Skip to content

Commit dd9ad85

Browse files
committed
Merge pull request #160 from wprater/add-replace-option
Add a replace option to force router to replace vs push state
2 parents b75b07e + e62a7f0 commit dd9ad85

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/directives/link.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export default function (Vue) {
3232
// v-link on <a v-link="'path'">
3333
e.preventDefault()
3434
if (this.destination != null) {
35-
router.go(this.destination)
35+
router.go(this.destination, this.replace === true)
3636
}
3737
} else {
3838
// v-link delegate on <div v-link>
@@ -57,6 +57,7 @@ export default function (Vue) {
5757

5858
update (path) {
5959
let router = this.vm.$route.router
60+
this.replace = typeof path === 'object' ? path.replace : false
6061
path = router._normalizePath(path)
6162
this.destination = path
6263
this.activeRE = path

0 commit comments

Comments
 (0)