Ryan Chandler 4 rokov pred
rodič
commit
1aacb42b0c
1 zmenil súbory, kde vykonal 9 pridanie a 9 odobranie
  1. 9 9
      src/directives/bind.js

+ 9 - 9
src/directives/bind.js

@@ -28,14 +28,14 @@ export function handleAttributeBindingDirective(component, el, attrName, express
             if (typeof value === 'string' && attrType === 'bind') {
                 el.value = value
             } else if (attrType !== 'bind') {
-               if (Array.isArray(value)) {
-                // I'm purposely not using Array.includes here because it's
-                // strict, and because of Numeric/String mis-casting, I
-                // want the "includes" to be "fuzzy".
-                el.checked = value.some(val => val == el.value)
-              } else {
-                el.checked = !! value
-              }
+                if (Array.isArray(value)) {
+                    // I'm purposely not using Array.includes here because it's
+                    // strict, and because of Numeric/String mis-casting, I
+                    // want the "includes" to be "fuzzy".
+                    el.checked = value.some(val => val == el.value)
+                } else {
+                    el.checked = !!value
+                }
             }
         } else if (el.tagName === 'SELECT') {
             updateSelect(el, value)
@@ -78,7 +78,7 @@ export function handleAttributeBindingDirective(component, el, attrName, express
 }
 
 function setIfChanged(el, attrName, value) {
-    if (el.getAttribute(attrName) != value){
+    if (el.getAttribute(attrName) != value) {
         el.setAttribute(attrName, value)
     }
 }