update upload demo

This commit is contained in:
afc163 2017-03-08 14:42:34 +08:00
parent ff2e793fc7
commit 35642ec2a9

View File

@ -17,22 +17,31 @@ If uploade file is picture, a thumbnail can be shown. `IE8/9` do not support loc
````jsx
import { Upload, Button, Icon } from 'antd';
const fileList = [{
uid: -1,
name: 'xxx.png',
status: 'done',
url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
thumbUrl: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
}, {
uid: -2,
name: 'yyy.png',
status: 'done',
url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
thumbUrl: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
}];
const props = {
action: '//jsonplaceholder.typicode.com/posts/',
listType: 'picture',
defaultFileList: [{
uid: -1,
name: 'xxx.png',
status: 'done',
url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
thumbUrl: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
}, {
uid: -2,
name: 'yyy.png',
status: 'done',
url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
thumbUrl: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
}],
defaultFileList: [...fileList],
};
const props2 = {
action: '//jsonplaceholder.typicode.com/posts/',
listType: 'picture',
defaultFileList: [...fileList],
className: 'upload-list-inline',
};
ReactDOM.render(
@ -44,7 +53,7 @@ ReactDOM.render(
</Upload>
<br />
<br />
<Upload {...props} className="upload-list-inline">
<Upload {...props2}>
<Button>
<Icon type="upload" /> upload
</Button>