Procházet zdrojové kódy

use null check for old attrs

Evan You před 10 roky
rodič
revize
f3970f8c5a
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      src/runtime/vdom/modules/attrs.js

+ 1 - 1
src/runtime/vdom/modules/attrs.js

@@ -35,7 +35,7 @@ function updateAttrs (oldVnode, vnode) {
   // use `in` operator since the previous `for` iteration uses it (.i.e. add even attributes with undefined value)
   // the other option is to remove all attributes with value == undefined
   for (key in oldAttrs) {
-    if (!(key in attrs)) {
+    if (attrs[key] == null) {
       elm.removeAttribute(key)
     }
   }