fix(runtime-dom): cast to true for boolean props

This commit is contained in:
Evan You 2019-10-11 18:59:39 -04:00
parent b0156b5df3
commit 59e18e5478

View File

@ -18,5 +18,10 @@ export function patchDOMProp(
// non-string values will be stringified. // non-string values will be stringified.
el._value = value el._value = value
} }
if (value === '' && typeof el[key] === 'boolean') {
// e.g. <select multiple> compiles to { multiple: '' }
el[key] = true
} else {
el[key] = value == null ? '' : value el[key] = value == null ? '' : value
}
} }