update dragger demo

This commit is contained in:
afc163 2016-07-29 14:40:19 +08:00
parent 877239bfe5
commit 10a0709b3a

View File

@ -6,13 +6,23 @@ title: 拖拽上传
可以把文件拖入指定区域,完成上传,同样支持点击上传。
````jsx
import { Upload, Icon } from 'antd';
import { Upload, Icon, message } from 'antd';
const Dragger = Upload.Dragger;
const props = {
name: 'file',
showUploadList: false,
action: '/upload.do',
onChange(info) {
if (info.file.status !== 'uploading') {
console.log(info.file, info.fileList);
}
if (info.file.status === 'done') {
message.success(`${info.file.name} 上传成功。`);
} else if (info.file.status === 'error') {
message.error(`${info.file.name} 上传失败。`);
}
},
};
ReactDOM.render(