diff --git a/CHANGELOG.md b/CHANGELOG.md index f6702048..3c8970ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ ## 更新日志 +### 1.0.0-rc.7 + +*2016-XX-XX* + +- Upload 新增 Data 属性支持额外数据的传输 + ### 1.0.0-rc.6 *2016-10-11* diff --git a/packages/upload/src/index.vue b/packages/upload/src/index.vue index e51ac9ea..7b27f127 100644 --- a/packages/upload/src/index.vue +++ b/packages/upload/src/index.vue @@ -31,18 +31,13 @@ export default { }; } }, - multiple: { - type: Boolean, - default: false - }, + data: Object, + multiple: Boolean, name: { type: String, default: 'file' }, - withCredentials: { - type: Boolean, - default: false - }, + withCredentials: Boolean, thumbnailMode: Boolean, showUploadList: { type: Boolean, @@ -179,6 +174,7 @@ export default { 'with-credentials': this.withCredentials, headers: this.headers, name: this.name, + data: this.data, accept: this.thumbnailMode ? 'image/*' : this.accept, 'on-start': this.handleStart, 'on-progress': this.handleProgress, diff --git a/packages/upload/src/upload.vue b/packages/upload/src/upload.vue index b931addd..20ede25b 100644 --- a/packages/upload/src/upload.vue +++ b/packages/upload/src/upload.vue @@ -34,6 +34,7 @@ export default { type: String, default: 'file' }, + data: Object, headers: Object, withCredentials: Boolean, multiple: Boolean, @@ -133,6 +134,7 @@ export default { headers: this.headers, withCredentials: this.withCredentials, file: file, + data: this.data, filename: this.name, onProgress: e => { this.onProgress(e, file);