You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
695 B
Markdown
36 lines
695 B
Markdown
9 years ago
|
# 图片列表样式
|
||
|
|
||
|
- order: 6
|
||
|
|
||
|
上传文件为图片,可展示缩略图。
|
||
|
|
||
|
---
|
||
|
|
||
|
````jsx
|
||
|
import { Upload, Button, Icon } from 'antd';
|
||
|
|
||
|
const props = {
|
||
|
action: '/upload.do',
|
||
|
listType: 'picture',
|
||
|
defaultFileList: [{
|
||
|
uid: -1,
|
||
|
name: 'xxx.png',
|
||
|
status: 'done',
|
||
|
url: 'https://os.alipayobjects.com/rmsportal/NDbkJhpzmLxtPhB.png'
|
||
|
}, {
|
||
|
uid: -2,
|
||
|
name: 'yyy.png',
|
||
|
status: 'done',
|
||
|
url: 'https://os.alipayobjects.com/rmsportal/NDbkJhpzmLxtPhB.png'
|
||
|
}]
|
||
|
};
|
||
|
|
||
|
ReactDOM.render(
|
||
|
<Upload {...props}>
|
||
|
<Button type="ghost">
|
||
|
<Icon type="upload" /> 点击上传
|
||
|
</Button>
|
||
|
</Upload>
|
||
|
, document.getElementById('components-upload-demo-picture-style'));
|
||
|
````
|