소스 검색

Update src/directives/for.js

Co-authored-by: Ryan Chandler <ryangjchandler@gmail.com>
Peter Minne 4 년 전
부모
커밋
5ae82e268d
1개의 변경된 파일2개의 추가작업 그리고 5개의 파일을 삭제
  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