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 e9fcaa9 + 1d4ea8e commit b00dbcaCopy full SHA for b00dbca
src/directives/public/bind.js
@@ -132,9 +132,9 @@ export default {
132
}
133
setClass(el, value)
134
} else if (xlinkRE.test(attr)) {
135
- el.setAttributeNS(xlinkNS, attr, value)
+ el.setAttributeNS(xlinkNS, attr, value === true ? '' : value)
136
} else {
137
- el.setAttribute(attr, value)
+ el.setAttribute(attr, value === true ? '' : value)
138
139
140
el.removeAttribute(attr)
test/unit/specs/directives/public/bind_spec.js
@@ -24,6 +24,8 @@ describe('v-bind', function () {
24
expect(el.hasAttribute('test')).toBe(false)
25
dir.update(false)
26
27
+ dir.update(true)
28
+ expect(el.getAttribute('test')).toBe('')
29
dir.update(0)
30
expect(el.getAttribute('test')).toBe('0')
31
})
0 commit comments