{"action":"created","issue":{"url":"https://api.github.com/repos/ant-design/ant-design/issues/1961","repository_url":"https://api.github.com/repos/ant-design/ant-design","labels_url":"https://api.github.com/repos/ant-design/ant-design/issues/1961/labels{/name}","comments_url":"https://api.github.com/repos/ant-design/ant-design/issues/1961/comments","events_url":"https://api.github.com/repos/ant-design/ant-design/issues/1961/events","html_url":"https://github.com/ant-design/ant-design/issues/1961","id":158339871,"number":1961,"title":"Upload 上传，如何修改列表位置，从新定义了一个fileItems，this.handleChange在里面this.setState不管用","user":{"login":"EagleWolf","id":4488399,"avatar_url":"https://avatars.githubusercontent.com/u/4488399?v=3","gravatar_id":"","url":"https://api.github.com/users/EagleWolf","html_url":"https://github.com/EagleWolf","followers_url":"https://api.github.com/users/EagleWolf/followers","following_url":"https://api.github.com/users/EagleWolf/following{/other_user}","gists_url":"https://api.github.com/users/EagleWolf/gists{/gist_id}","starred_url":"https://api.github.com/users/EagleWolf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EagleWolf/subscriptions","organizations_url":"https://api.github.com/users/EagleWolf/orgs","repos_url":"https://api.github.com/users/EagleWolf/repos","events_url":"https://api.github.com/users/EagleWolf/events{/privacy}","received_events_url":"https://api.github.com/users/EagleWolf/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-06-03T10:41:43Z","updated_at":"2016-06-03T11:21:17Z","closed_at":"2016-06-03T11:18:15Z","body":"http://ant.design/components/upload/#components-upload-demo-fileList\r\n使用上面的例子，如果使用默认的fileList，布局不是想要的布局，重新定义了一个fileItems，this.handleChange里面this.setState不管用了。\r\n\r\n`class Files extends React.Component {\r\n  constructor(props){\r\n      super(props);\r\n      this.state = {\r\n        fileItems: [{\r\n          name: '00文字说明文字说明文字说明文字说明文字说明',\r\n          icon: './static/images/excel.png',\r\n          url: 'http://www.baidu.com/xxx.png'\r\n        }]\r\n      };\r\n  }\r\n  handleChange(info) {\r\n    this.setState({filelist:[{\r\n      name: '00文字说明文字说明文字说明文字说明文字说明',\r\n      icon: './static/images/excel.png',\r\n      url: 'http://www.baidu.com/xxx.png'\r\n    }]})\r\n  }\r\n  render() {\r\n    //上传文件\r\n    const UploadProps = {\r\n      name: 'file',\r\n      listType: 'picture',\r\n      action: '/upload.do',\r\n      onChange: this.handleChange\r\n    }\r\n    return (\r\n      <QueueAnim delay={300}>\r\n        <div className=\"pad-20 clearfix\" key=\"1\">\r\n          <div className=\"pull-left\">\r\n            <Classify current={3} />\r\n          </div>\r\n          <div className=\"pull-right\">\r\n            <Upload {...UploadProps} fileItems={this.state.fileItems}>\r\n              <Button type='dashed' icon=\"upload\" size=\"large\">上传文件</Button>\r\n            </Upload>\r\n          </div>\r\n        </div>\r\n        <div className=\"pad-20\" key=\"2\">\r\n          <ul className=\"clearfix list\">\r\n            {this.state.fileItems.map((data, index) => <li key={index}>\r\n              <Icon type=\"delete\" />\r\n              <img src={data.icon} />\r\n              <p>{data.name}</p>\r\n            </li>)}\r\n          </ul>\r\n        </div>\r\n      </QueueAnim>\r\n    )\r\n  }\r\n}`"},"comment":{"url":"https://api.github.com/repos/ant-design/ant-design/issues/comments/223554410","html_url":"https://github.com/ant-design/ant-design/issues/1961#issuecomment-223554410","issue_url":"https://api.github.com/repos/ant-design/ant-design/issues/1961","id":223554410,"user":{"login":"EagleWolf","id":4488399,"avatar_url":"https://avatars.githubusercontent.com/u/4488399?v=3","gravatar_id":"","url":"https://api.github.com/users/EagleWolf","html_url":"https://github.com/EagleWolf","followers_url":"https://api.github.com/users/EagleWolf/followers","following_url":"https://api.github.com/users/EagleWolf/following{/other_user}","gists_url":"https://api.github.com/users/EagleWolf/gists{/gist_id}","starred_url":"https://api.github.com/users/EagleWolf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EagleWolf/subscriptions","organizations_url":"https://api.github.com/users/EagleWolf/orgs","repos_url":"https://api.github.com/users/EagleWolf/repos","events_url":"https://api.github.com/users/EagleWolf/events{/privacy}","received_events_url":"https://api.github.com/users/EagleWolf/received_events","type":"User","site_admin":false},"created_at":"2016-06-03T11:21:17Z","updated_at":"2016-06-03T11:21:17Z","body":"主要想怎么修改，图片列表的默认布局。"}}
{"actor":{"display_login":"EagleWolf"}}