]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
refactor(runtime-dom): avoid unnecessary checks in patchDOMProp (#452)
authorCédric Exbrayat <cexbrayat@users.noreply.github.com>
Thu, 14 Nov 2019 16:27:23 +0000 (17:27 +0100)
committerEvan You <yyx990803@gmail.com>
Thu, 14 Nov 2019 16:27:23 +0000 (11:27 -0500)
packages/runtime-dom/src/modules/props.ts

index fbaaac2c8e8c79f395d72994f2226cd2859b24f5..e723e2c8bdc7f4c38b1d4e0e0f6c5f10613d2dfe 100644 (file)
@@ -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: '' }