mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 19:19:57 +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
|
||||
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>
|
||||
|
Loading…
Reference in New Issue
Block a user