mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 19:19:57 +08:00
feat add uploadlist config and fix color
This commit is contained in:
parent
440f69a800
commit
9cb8bef1ad
@ -12,6 +12,7 @@ const Dragger = Upload.Dragger;
|
||||
|
||||
const props = {
|
||||
name: 'file',
|
||||
uploadList: false,
|
||||
action: '/upload.do'
|
||||
};
|
||||
|
||||
|
@ -12,6 +12,7 @@ const Dragger = Upload.Dragger;
|
||||
|
||||
const props = {
|
||||
name: 'file',
|
||||
uploadList: false,
|
||||
action: '/upload.do'
|
||||
};
|
||||
|
||||
|
@ -168,6 +168,7 @@ const AntUpload = React.createClass({
|
||||
data: {},
|
||||
accept: '',
|
||||
onChange: noop,
|
||||
uploadList: true
|
||||
};
|
||||
},
|
||||
componentWillReceiveProps(nextProps) {
|
||||
@ -188,6 +189,10 @@ const AntUpload = React.createClass({
|
||||
onProgress: this.onProgress,
|
||||
onSuccess: this.onSuccess,
|
||||
});
|
||||
let uploadList;
|
||||
if (this.props.uploadList) {
|
||||
uploadList = <UploadList items={this.state.fileList} onRemove={this.handleManualRemove} />;
|
||||
}
|
||||
if (type === 'drag') {
|
||||
let dragUploadingClass = '';
|
||||
let fileList = this.state.fileList;
|
||||
@ -206,8 +211,7 @@ const AntUpload = React.createClass({
|
||||
</div>
|
||||
</Upload>
|
||||
</div>
|
||||
<UploadList items={this.state.fileList}
|
||||
onRemove={this.handleManualRemove} />
|
||||
{ uploadList }
|
||||
</div>
|
||||
);
|
||||
} else if (type === 'select') {
|
||||
@ -218,8 +222,7 @@ const AntUpload = React.createClass({
|
||||
{this.props.children}
|
||||
</Upload>
|
||||
</div>
|
||||
<UploadList items={this.state.fileList}
|
||||
onRemove={this.handleManualRemove} />
|
||||
{ uploadList }
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
@ -23,10 +23,12 @@
|
||||
| name | 可选参数, 上传的文件 | String | file |
|
||||
| action | 必选参数, 上传的地址 | String | 无 |
|
||||
| data | 可选参数, 上传所需参数 | Object | 无 |
|
||||
| uploadList | 可选参数, 是否开启uploadList, 默认开启 | Boolean | true |
|
||||
| multiple | 可选参数, 是否支持多选文件,支持 `ie10+` | Boolean | false |
|
||||
| accept | 可选参数, 接受上传的文件类型, 详见 input accept Attribute | String | 无 |
|
||||
| onChange | 可选参数, 上传文件改变时的状态,详见 onChange | Function | 无 |
|
||||
|
||||
|
||||
### onChange
|
||||
|
||||
文件状态改变的回调,返回为:
|
||||
|
@ -40,7 +40,7 @@
|
||||
}
|
||||
|
||||
&.@{upload-prefix-cls}-drag-uploading {
|
||||
border-color: tint(@primary-color, 30%);
|
||||
border-color: tint(@primary-color, 20%);
|
||||
}
|
||||
|
||||
p.@{upload-prefix-cls}-drag-icon {
|
||||
@ -81,7 +81,7 @@
|
||||
margin-top: 8px;
|
||||
color: #999;
|
||||
:hover {
|
||||
background-color: tint(@primary-color, 80%);
|
||||
background-color: tint(@primary-color, 90%);
|
||||
.anticon.anticon-cross {
|
||||
display: inline-block;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user