refactor(runtime-dom): avoid unnecessary checks in patchDOMProp (#452)
This commit is contained in:
parent
8e8397374c
commit
8688acc36f
@ -12,11 +12,15 @@ export function patchDOMProp(
|
||||
) {
|
||||
if ((key === 'innerHTML' || key === 'textContent') && prevChildren != null) {
|
||||
unmountChildren(prevChildren, parentComponent, parentSuspense)
|
||||
el[key] = value == null ? '' : value
|
||||
return
|
||||
}
|
||||
if (key === 'value' && el.tagName !== 'PROGRESS') {
|
||||
// store value as _value as well since
|
||||
// non-string values will be stringified.
|
||||
el._value = value
|
||||
el.value = value == null ? '' : value
|
||||
return
|
||||
}
|
||||
if (value === '' && typeof el[key] === 'boolean') {
|
||||
// e.g. <select multiple> compiles to { multiple: '' }
|
||||
|
Loading…
Reference in New Issue
Block a user