瀏覽代碼

remove unecessary change

Hugo Di Francesco 5 年之前
父節點
當前提交
6bac86f58c
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/directives/bind.js

+ 2 - 2
src/directives/bind.js

@@ -69,10 +69,10 @@ export function handleAttributeBindingDirective(component, el, attrName, express
             el.setAttribute('class', arrayUnique(originalClasses.concat(newClasses)).join(' '))
         }
     } else if (isBooleanAttr(attrName)) {
-        if (!!value) {
+        // Boolean attributes have to be explicitly added and removed, not just set.
+        if (!! value) {
             el.setAttribute(attrName, '')
         } else {
-            // If a Boolean attribute has a falsy value, remove the attribute
             el.removeAttribute(attrName)
         }
     } else {