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.
1 parent fbd874f commit d831a43Copy full SHA for d831a43
src/directives/attr.js
@@ -16,7 +16,7 @@ module.exports = {
16
}
17
18
function defaultHandler (value) {
19
- if (value != null) {
+ if (value || value === 0) {
20
this.el.setAttribute(this.arg, value)
21
} else {
22
this.el.removeAttribute(this.arg)
test/unit/specs/directives/attr_spec.js
@@ -22,6 +22,10 @@ if (_.inBrowser) {
expect(el.getAttribute('test')).toBe('again')
23
dir.update(null)
24
expect(el.hasAttribute('test')).toBe(false)
25
+ dir.update(false)
26
+ expect(el.hasAttribute('test')).toBe(false)
27
+ dir.update(0)
28
+ expect(el.getAttribute('test')).toBe('0')
29
})
30
31
it('xlink', function () {
0 commit comments