Skip to content

Commit 1f18055

Browse files
committed
fix router-link not updating static inner <a> (fix #810)
1 parent 0cf8018 commit 1f18055

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/components/link.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,12 @@ export default {
6969
// find the first <a> child and apply listener and href
7070
const a = findAnchor(this.$slots.default)
7171
if (a) {
72-
const aData = a.data || (a.data = {})
72+
// in case the <a> is a static node
73+
a.isStatic = false
74+
const extend = this.constructor.super.util.extend
75+
const aData = a.data = extend({}, a.data)
7376
aData.on = on
74-
const aAttrs = aData.attrs || (aData.attrs = {})
77+
const aAttrs = a.data.attrs = extend({}, a.data.attrs)
7578
aAttrs.href = href
7679
} else {
7780
// doesn't have <a> child, apply listener to self

0 commit comments

Comments
 (0)