ant-design/components/upload/demo/basic.md

32 lines
550 B
Markdown
Raw Normal View History

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-08 23:37:35 +08:00
---
````jsx
var Upload = antd.Upload;
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(
<Upload {...props}>
2015-08-18 17:05:56 +08:00
<button className="ant-btn ant-btn-ghost">
<i className="anticon anticon-upload"></i> 点击上传
</button>
</Upload>,
document.getElementById('components-upload-demo-basic')
2015-08-08 23:37:35 +08:00
);
````