2016-03-31 09:40:55 +08:00
|
|
|
---
|
|
|
|
order: 5
|
2016-04-05 13:34:44 +08:00
|
|
|
hidden: true
|
2016-08-25 09:46:19 +08:00
|
|
|
title:
|
|
|
|
zh-CN: 多文件选择
|
|
|
|
en-US: Multifile Selection
|
2016-03-31 09:40:55 +08:00
|
|
|
---
|
2015-09-08 17:26:32 +08:00
|
|
|
|
2016-08-25 09:46:19 +08:00
|
|
|
## zh-CN
|
|
|
|
|
2015-09-08 17:26:32 +08:00
|
|
|
按住 ctrl 可选择多个文件,`ie10+` 支持。
|
|
|
|
|
2016-08-25 09:46:19 +08:00
|
|
|
## en-US
|
|
|
|
|
|
|
|
You can select multiple files with CTRL holding down. `IE10+` supported.
|
|
|
|
|
2015-09-08 17:26:32 +08:00
|
|
|
````jsx
|
2015-10-28 20:55:49 +08:00
|
|
|
import { Upload, message, Button, Icon } from 'antd';
|
2015-09-08 17:26:32 +08:00
|
|
|
|
2015-10-28 20:55:49 +08:00
|
|
|
const props = {
|
2015-09-08 17:26:32 +08:00
|
|
|
action: '/upload.do',
|
|
|
|
multiple: true,
|
|
|
|
onChange(info) {
|
|
|
|
if (info.file.status !== 'uploading') {
|
|
|
|
console.log(info.file, info.fileList);
|
|
|
|
}
|
2015-09-08 18:05:55 +08:00
|
|
|
if (info.file.status === 'done') {
|
2016-08-25 09:46:19 +08:00
|
|
|
message.success(`${info.file.name} upload sucessfully。`);
|
2015-09-14 00:28:39 +08:00
|
|
|
} else if (info.file.status === 'error') {
|
2016-08-25 09:46:19 +08:00
|
|
|
message.error(`${info.file.name} upload unsuccessfully。`);
|
2015-09-08 18:05:55 +08:00
|
|
|
}
|
2016-05-11 09:32:33 +08:00
|
|
|
},
|
2015-09-08 17:26:32 +08:00
|
|
|
};
|
|
|
|
|
2015-10-20 16:47:55 +08:00
|
|
|
ReactDOM.render(
|
2015-09-08 17:26:32 +08:00
|
|
|
<Upload {...props}>
|
2015-10-08 15:13:04 +08:00
|
|
|
<Button type="ghost">
|
2016-08-25 09:46:19 +08:00
|
|
|
<Icon type="upload" /> upload
|
2015-10-08 15:13:04 +08:00
|
|
|
</Button>
|
2015-09-08 17:26:32 +08:00
|
|
|
</Upload>
|
2015-12-29 12:08:58 +08:00
|
|
|
, mountNode);
|
2015-09-08 17:26:32 +08:00
|
|
|
````
|