diff --git a/packages/fes-ui/examples/views/component/upload.vue b/packages/fes-ui/examples/views/component/upload.vue index e861bd2f..055fcfae 100644 --- a/packages/fes-ui/examples/views/component/upload.vue +++ b/packages/fes-ui/examples/views/component/upload.vue @@ -8,7 +8,7 @@
- +
@@ -133,11 +133,11 @@ export default { }, methods: { sucess(file, result, arg) { - + }, - fail() { - console.log(arguments) + fail(files, status) { + console.log(files) } } } - \ No newline at end of file + diff --git a/packages/fes-ui/package.json b/packages/fes-ui/package.json index fa803d56..43720d10 100644 --- a/packages/fes-ui/package.json +++ b/packages/fes-ui/package.json @@ -1,6 +1,6 @@ { "name": "@webank/fes-ui", - "version": "0.4.9", + "version": "0.4.10", "description": "基于Vue2.0,适用于PC管理端的组件库", "main": "dist/fes-ui.js", "scripts": { diff --git a/packages/fes-ui/src/components/upload/upload.vue b/packages/fes-ui/src/components/upload/upload.vue index b49f161b..33e39bfb 100644 --- a/packages/fes-ui/src/components/upload/upload.vue +++ b/packages/fes-ui/src/components/upload/upload.vue @@ -133,8 +133,10 @@ export default { const files = e.target.files; const len = files.length; const validateArray = []; + const validateFiles = []; for (let i = 0; i < len; i++) { const file = e.target.files[i]; + validateFiles.push(file); validateArray.push(this.validate(file)); } Promise.all(validateArray).then( @@ -159,12 +161,12 @@ export default { ) { try { const result = JSON.parse(xhr.responseText); - this.$emit('on-success', files, result); + this.$emit('on-success', validateFiles, result); } catch (e1) { console.error('响应格式不正确'); } } else { - this.$emit('on-fail', files, xhr.status); + this.$emit('on-fail', validateFiles, xhr.status); } this.$refs.input.value = ''; } @@ -179,7 +181,7 @@ export default { if (this.action) { this.action(false); } else { - this.$emit('on-fail', files, -1); + this.$emit('on-fail', validateFiles, -1); } } );