Skip to content

Commit d9367ae

Browse files
authored
Resolve conflict between multiple and crop/resize
For compress multiple images, last time i modified tryAjaxUpload() which turned out can't crop or resize image, that because corp/resize a image use a <img /> as parameter but multiple compress use Files. Now deal them seperately in isBinary.
1 parent 1cdde94 commit d9367ae

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/vue-core-image-upload.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,11 +263,14 @@
263263
}
264264
let data;
265265
if (isBinary) {
266+
var dataType = base64Code['type'] ? base64Code['type'] : this.files[0]['type'];
267+
var dataName = base64Code['name'] ? encodeURI(base64Code['name']) : this.files[0]['name'];
268+
var code = base64Code['base64Code'] ? base64Code['base64Code'] : base64Code;
266269
data = {
267-
type: base64Code['type'],
268-
filename: encodeURI(base64Code['name']),
270+
type: dataType,
271+
filename: dataName,
269272
filed: this.inputOfFile,
270-
base64Code: base64Code['base64Code']
273+
base64Code: code
271274
};
272275
if (typeof this.data === 'object') {
273276
data = Object.assign(this.data, data);

0 commit comments

Comments
 (0)