Browse Source

docs: Rewrite Upload demos to ES6 component

pull/4943/head
bang 8 years ago
parent
commit
a4acf1f66e
  1. 28
      components/upload/demo/fileList.md

28
components/upload/demo/fileList.md

@ -28,18 +28,16 @@ You can gain full control over filelist by configuring `fileList`. You can accom
````jsx
import { Upload, Button, Icon } from 'antd';
const MyUpload = React.createClass({
getInitialState() {
return {
fileList: [{
uid: -1,
name: 'xxx.png',
status: 'done',
url: 'http://www.baidu.com/xxx.png',
}],
};
},
handleChange(info) {
class MyUpload extends React.Component {
state = {
fileList: [{
uid: -1,
name: 'xxx.png',
status: 'done',
url: 'http://www.baidu.com/xxx.png',
}],
}
handleChange = (info) => {
let fileList = info.fileList;
// 1. Limit the number of uploaded files
@ -64,7 +62,7 @@ const MyUpload = React.createClass({
});
this.setState({ fileList });
},
}
render() {
const props = {
action: '/upload.do',
@ -78,8 +76,8 @@ const MyUpload = React.createClass({
</Button>
</Upload>
);
},
});
}
}
ReactDOM.render(<MyUpload />, mountNode);
````

Loading…
Cancel
Save