mirror of
https://github.com/ant-design/ant-design.git
synced 2025-07-26 00:26:53 +08:00
update upload demo
This commit is contained in:
parent
ff2e793fc7
commit
35642ec2a9
@ -17,22 +17,31 @@ 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 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 = {
|
const props = {
|
||||||
action: '//jsonplaceholder.typicode.com/posts/',
|
action: '//jsonplaceholder.typicode.com/posts/',
|
||||||
listType: 'picture',
|
listType: 'picture',
|
||||||
defaultFileList: [{
|
defaultFileList: [...fileList],
|
||||||
uid: -1,
|
};
|
||||||
name: 'xxx.png',
|
|
||||||
status: 'done',
|
const props2 = {
|
||||||
url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
|
action: '//jsonplaceholder.typicode.com/posts/',
|
||||||
thumbUrl: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
|
listType: 'picture',
|
||||||
}, {
|
defaultFileList: [...fileList],
|
||||||
uid: -2,
|
className: 'upload-list-inline',
|
||||||
name: 'yyy.png',
|
|
||||||
status: 'done',
|
|
||||||
url: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
|
|
||||||
thumbUrl: 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png',
|
|
||||||
}],
|
|
||||||
};
|
};
|
||||||
|
|
||||||
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>
|
||||||
|
Loading…
Reference in New Issue
Block a user