From 98275fd898df0711b4e31c6705c8cd66f790816e Mon Sep 17 00:00:00 2001 From: iceman1212 Date: Thu, 3 Dec 2015 13:50:07 +0800 Subject: =?UTF-8?q?SCRIPT5028:=20Function.prototype.apply:=20=E7=BC=BA?= =?UTF-8?q?=E5=B0=91=20Array=20=E6=88=96=20arguments=20=E5=AF=B9=E8=B1=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SCRIPT5028: Function.prototype.apply: 缺少 Array 或 arguments 对象 --- src/module/Panel.jsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/module/Panel.jsx b/src/module/Panel.jsx index b91c6fe..4c7eaae 100644 --- a/src/module/Panel.jsx +++ b/src/module/Panel.jsx @@ -7,9 +7,11 @@ function noop() { } function generateOptions(length) { - return Array.apply(null, {length: length}).map((item, index) => { - return index; - }); + const arr = []; + for(let i = 0; i < length; i++){ + arr.push(i); + } + return arr; } const Panel = React.createClass({ -- cgit v1.2.3