mirror of https://github.com/vuejs/vue.git
set property for "muted" in v-bind (fix #2042)
This commit is contained in:
parent
e1d6b3ede8
commit
90c92fbdb1
|
@ -5,13 +5,12 @@ import vStyle from '../internal/style'
|
||||||
const xlinkNS = 'http://www.w3.org/1999/xlink'
|
const xlinkNS = 'http://www.w3.org/1999/xlink'
|
||||||
const xlinkRE = /^xlink:/
|
const xlinkRE = /^xlink:/
|
||||||
|
|
||||||
// these input element attributes should also set their
|
// check for attributes that prohibit interpolations
|
||||||
// corresponding properties
|
const disallowedInterpAttrRE = /^v-|^:|^@|^(is|transition|transition-mode|debounce|track-by|stagger|enter-stagger|leave-stagger)$/
|
||||||
const inputProps = {
|
|
||||||
value: 1,
|
// these attributes should also set their corresponding properties
|
||||||
checked: 1,
|
// because they only affect the initial state of the element
|
||||||
selected: 1
|
const attrWithPropsRE = /^(value|checked|selected|muted)$/
|
||||||
}
|
|
||||||
|
|
||||||
// these attributes should set a hidden property for
|
// these attributes should set a hidden property for
|
||||||
// binding v-model to object values
|
// binding v-model to object values
|
||||||
|
@ -21,9 +20,6 @@ const modelProps = {
|
||||||
'false-value': '_falseValue'
|
'false-value': '_falseValue'
|
||||||
}
|
}
|
||||||
|
|
||||||
// check for attributes that prohibit interpolations
|
|
||||||
const disallowedInterpAttrRE = /^v-|^:|^@|^(is|transition|transition-mode|debounce|track-by|stagger|enter-stagger|leave-stagger)$/
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
priority: 850,
|
priority: 850,
|
||||||
|
@ -90,7 +86,11 @@ export default {
|
||||||
handleObject: vStyle.handleObject,
|
handleObject: vStyle.handleObject,
|
||||||
|
|
||||||
handleSingle (attr, value) {
|
handleSingle (attr, value) {
|
||||||
if (inputProps[attr] && attr in this.el) {
|
if (
|
||||||
|
!this.descriptor.interp &&
|
||||||
|
attrWithPropsRE.test(attr) &&
|
||||||
|
attr in this.el
|
||||||
|
) {
|
||||||
this.el[attr] = attr === 'value'
|
this.el[attr] = attr === 'value'
|
||||||
? value == null // IE9 will set input.value to "null" for null...
|
? value == null // IE9 will set input.value to "null" for null...
|
||||||
? ''
|
? ''
|
||||||
|
|
|
@ -7,7 +7,10 @@ describe('v-bind', function () {
|
||||||
var el, dir
|
var el, dir
|
||||||
beforeEach(function () {
|
beforeEach(function () {
|
||||||
el = document.createElement('div')
|
el = document.createElement('div')
|
||||||
dir = {el: el}
|
dir = {
|
||||||
|
el: el,
|
||||||
|
descriptor: {}
|
||||||
|
}
|
||||||
_.extend(dir, def)
|
_.extend(dir, def)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue