mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-04 00:49:39 +08:00
b68ec83e36
1. 使用 Upload.dragger 代替 type 2. 将拖拽上传的内容区域交给用户自己实现 3. 改进 uploadList 的实现方式, 尽量避免使用 Dom 操作 4. 优化样式展现
31 lines
502 B
Markdown
31 lines
502 B
Markdown
# 点击上传
|
|
|
|
- order: 1
|
|
|
|
经典款式,用户点击按钮弹出文件选择框。
|
|
|
|
---
|
|
|
|
````jsx
|
|
var Upload = antd.Upload;
|
|
|
|
var props = {
|
|
description: '支持扩展名为: .rar .zip ...',
|
|
action: '/upload.do',
|
|
data: {},
|
|
accept: '',
|
|
uploadTip: '',
|
|
start: function(file){
|
|
console.log(file.name)
|
|
},
|
|
error: function() {},
|
|
success: function() {},
|
|
progress: function() {}
|
|
};
|
|
|
|
React.render(
|
|
<Upload {...props} />,
|
|
document.getElementById('components-upload-demo-basic')
|
|
);
|
|
````
|