Skip to content

Commit ef97eec

Browse files
committed
remove v-ref at component link (fix #1779)
1 parent 46ad8a1 commit ef97eec

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/directives/internal/component.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,15 @@ module.exports = {
4242
// create a ref anchor
4343
this.anchor = _.createAnchor('v-component')
4444
_.replace(this.el, this.anchor)
45-
// remove is attribute
45+
// remove is attribute.
46+
// this is removed during compilation, but because compilation is
47+
// cached, when the component is used elsewhere this attribute
48+
// will remain at link time.
4649
this.el.removeAttribute('is')
50+
// remove ref, same as above
51+
if (this.descriptor.ref) {
52+
this.el.removeAttribute('v-ref:' + _.hyphenate(this.descriptor.ref))
53+
}
4754
// if static, build right now.
4855
if (this.literal) {
4956
this.setComponent(this.expression)

0 commit comments

Comments
 (0)