Skip to content

Commit f05559d

Browse files
committed
Merge pull request #143 from lepture/prevent-link
prevent redirection
2 parents 3b8f148 + 770d9fa commit f05559d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/directives/link.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ export default function (Vue) {
2121
}
2222
let router = vm.$route.router
2323
this.handler = (e) => {
24+
// don't redirect with control keys
25+
if (e.metaKey || e.ctrlKey || e.shiftKey) return
26+
// don't redirect when preventDefault called
27+
if (e.defaultPrevented) return
28+
2429
if (e.button === 0) {
2530
e.preventDefault()
2631
if (this.destination != null) {

0 commit comments

Comments
 (0)