From: Cédric Exbrayat Date: Thu, 14 Nov 2019 16:27:23 +0000 (+0100) Subject: refactor(runtime-dom): avoid unnecessary checks in patchDOMProp (#452) X-Git-Tag: v3.0.0-alpha.0~200 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8688acc36f065ce8510ad8c38019a876ba0fd7e6;p=thirdparty%2Fvuejs%2Fcore.git refactor(runtime-dom): avoid unnecessary checks in patchDOMProp (#452) --- diff --git a/packages/runtime-dom/src/modules/props.ts b/packages/runtime-dom/src/modules/props.ts index fbaaac2c8e..e723e2c8bd 100644 --- a/packages/runtime-dom/src/modules/props.ts +++ b/packages/runtime-dom/src/modules/props.ts @@ -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.