From 9cb8bef1ad8fbdf1842662fadb018e947c8a50b7 Mon Sep 17 00:00:00 2001 From: "xiaosheng.lj" Date: Tue, 3 Nov 2015 15:06:30 +0800 Subject: [PATCH] feat add uploadlist config and fix color --- components/upload/demo/drag-simple.md | 1 + components/upload/demo/drag.md | 1 + components/upload/index.jsx | 11 +++++++---- components/upload/index.md | 2 ++ style/components/upload.less | 4 ++-- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/components/upload/demo/drag-simple.md b/components/upload/demo/drag-simple.md index 52f00921f5..b11ecde88f 100644 --- a/components/upload/demo/drag-simple.md +++ b/components/upload/demo/drag-simple.md @@ -12,6 +12,7 @@ const Dragger = Upload.Dragger; const props = { name: 'file', + uploadList: false, action: '/upload.do' }; diff --git a/components/upload/demo/drag.md b/components/upload/demo/drag.md index 25682ab863..7dc20600ab 100644 --- a/components/upload/demo/drag.md +++ b/components/upload/demo/drag.md @@ -12,6 +12,7 @@ const Dragger = Upload.Dragger; const props = { name: 'file', + uploadList: false, action: '/upload.do' }; diff --git a/components/upload/index.jsx b/components/upload/index.jsx index 4b5731e70a..6581021518 100644 --- a/components/upload/index.jsx +++ b/components/upload/index.jsx @@ -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 = ; + } if (type === 'drag') { let dragUploadingClass = ''; let fileList = this.state.fileList; @@ -206,8 +211,7 @@ const AntUpload = React.createClass({ - + { uploadList } ); } else if (type === 'select') { @@ -218,8 +222,7 @@ const AntUpload = React.createClass({ {this.props.children} - + { uploadList } ); } diff --git a/components/upload/index.md b/components/upload/index.md index 9483b3607b..bb42db2dbc 100644 --- a/components/upload/index.md +++ b/components/upload/index.md @@ -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 文件状态改变的回调,返回为: diff --git a/style/components/upload.less b/style/components/upload.less index 84321ce5fe..3ff397c7d3 100644 --- a/style/components/upload.less +++ b/style/components/upload.less @@ -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; }