1
0
Эх сурвалжийг харах

Merge pull request #513 from reed-jones/master

replace .forEach with .some on x-bind checkbox
Caleb Porzio 5 жил өмнө
parent
commit
88898db6e6

+ 1 - 8
src/directives/bind.js

@@ -23,14 +23,7 @@ export function handleAttributeBindingDirective(component, el, attrName, express
                 // 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".
-                let valueFound = false
-                value.forEach(val => {
-                    if (val == el.value) {
-                        valueFound = true
-                    }
-                })
-
-                el.checked = valueFound
+                el.checked = value.some(val => val == el.value)
             } else {
                 el.checked = !! value
             }