update upload demo

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

View File

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