Prechádzať zdrojové kódy

Update src/directives/for.js

Co-authored-by: Ryan Chandler <ryangjchandler@gmail.com>
Peter Minne 4 rokov pred
rodič
commit
5ae82e268d
1 zmenil súbory, kde vykonal 2 pridanie a 5 odobranie
  1. 2 5
      src/directives/for.js

+ 2 - 5
src/directives/for.js

@@ -96,11 +96,8 @@ function evaluateItemsAndReturnEmptyIfXIfIsPresentAndFalseOnElement(component, e
 
     // This adds support for the `i in n` syntax.
     if (isNumeric(items)) {
-        if(items > 0) {
-            items = Array.from(Array(items).keys(), i => i + 1)
-        } else if(items === 0) {
-            items = []
-        }
+        items = items > 0 ? Array.from(Array(items).keys(), i => i = 1) : []
+    }
     }
 
     return items