2015-08-08 23:37:35 +08:00
|
|
|
# 点击上传
|
|
|
|
|
2015-08-31 12:13:55 +08:00
|
|
|
- order: 0
|
2015-08-08 23:37:35 +08:00
|
|
|
|
2015-08-09 18:00:20 +08:00
|
|
|
经典款式,用户点击按钮弹出文件选择框。
|
2015-08-08 23:37:35 +08:00
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
````jsx
|
|
|
|
var Upload = antd.Upload;
|
2015-08-09 18:00:20 +08:00
|
|
|
|
2015-08-08 23:37:35 +08:00
|
|
|
var props = {
|
|
|
|
description: '支持扩展名为: .rar .zip ...',
|
|
|
|
action: '/upload.do',
|
|
|
|
data: {},
|
|
|
|
accept: '',
|
|
|
|
uploadTip: '',
|
2015-08-27 15:57:25 +08:00
|
|
|
onStart(file){
|
|
|
|
console.log(file.uid);
|
|
|
|
}
|
2015-08-08 23:37:35 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
React.render(
|
2015-08-18 15:33:48 +08:00
|
|
|
<Upload {...props}>
|
2015-08-18 17:05:56 +08:00
|
|
|
<button className="ant-btn ant-btn-ghost">
|
|
|
|
<i className="anticon anticon-upload"></i> 点击上传
|
|
|
|
</button>
|
2015-08-18 15:33:48 +08:00
|
|
|
</Upload>,
|
2015-08-09 18:00:20 +08:00
|
|
|
document.getElementById('components-upload-demo-basic')
|
2015-08-08 23:37:35 +08:00
|
|
|
);
|
|
|
|
````
|