mirror of https://github.com/vuejs/vue.git
allow empty/falsy values in v-bind:class array syntax
This commit is contained in:
parent
b7bc6e663a
commit
ab2ff32a88
|
@ -32,7 +32,9 @@ module.exports = {
|
||||||
handleArray: function (value) {
|
handleArray: function (value) {
|
||||||
this.cleanup(value)
|
this.cleanup(value)
|
||||||
for (var i = 0, l = value.length; i < l; i++) {
|
for (var i = 0, l = value.length; i < l; i++) {
|
||||||
addClass(this.el, value[i])
|
if (value[i]) {
|
||||||
|
addClass(this.el, value[i])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
this.prevKeys = value
|
this.prevKeys = value
|
||||||
},
|
},
|
||||||
|
|
|
@ -47,6 +47,8 @@ if (_.inBrowser) {
|
||||||
expect(el.className).toBe('a c d')
|
expect(el.className).toBe('a c d')
|
||||||
dir.update()
|
dir.update()
|
||||||
expect(el.className).toBe('a')
|
expect(el.className).toBe('a')
|
||||||
|
dir.update(['e', ''])
|
||||||
|
expect(el.className).toBe('a e')
|
||||||
})
|
})
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue