Selaa lähdekoodia

fix(core): only unset dom prop when not present

fix #9650
Evan You 7 vuotta sitten
vanhempi
commit
f11449d916
1 muutettua tiedostoa jossa 2 lisäystä ja 1 poistoa
  1. 2 1
      src/platforms/web/runtime/modules/dom-props.js

+ 2 - 1
src/platforms/web/runtime/modules/dom-props.js

@@ -19,10 +19,11 @@ function updateDOMProps (oldVnode: VNodeWithData, vnode: VNodeWithData) {
   }
 
   for (key in oldProps) {
-    if (isUndef(props[key])) {
+    if (!(key in props)) {
       elm[key] = ''
     }
   }
+
   for (key in props) {
     cur = props[key]
     // ignore children if the node has textContent or innerHTML,