|
|
@ -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> |
|
|
|