mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-06 16:06:28 +08:00
update dragger demo
This commit is contained in:
parent
877239bfe5
commit
10a0709b3a
@ -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(
|
||||
|
Loading…
Reference in New Issue
Block a user