We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 314e722 + 8d3a3d8 commit 1e33f66Copy full SHA for 1e33f66
src/directives/link.js
@@ -42,14 +42,22 @@ export default function (Vue) {
42
while (el && el.tagName !== 'A' && el !== this.el) {
43
el = el.parentNode
44
}
45
- if (!el || el.tagName !== 'A' || !el.href) return
46
- if (sameOrigin(el)) {
+ if (!el) return
+ if (el.tagName !== 'A' || !el.href) {
47
+ // allow not anchor
48
e.preventDefault()
- router.go({
49
- path: el.pathname,
50
- replace: target && target.replace,
51
- append: target && target.append
52
- })
+ if (target != null) {
+ router.go(target)
+ }
+ } else {
53
+ if (sameOrigin(el)) {
54
+ e.preventDefault()
55
+ router.go({
56
+ path: el.pathname,
57
+ replace: target && target.replace,
58
+ append: target && target.append
59
+ })
60
61
62
63
0 commit comments