diff --git a/components/vc-upload/demo/beforeUpload.jsx b/components/vc-upload/demo/beforeUpload.jsx index 4292a9624..2e1e0be38 100644 --- a/components/vc-upload/demo/beforeUpload.jsx +++ b/components/vc-upload/demo/beforeUpload.jsx @@ -30,9 +30,11 @@ export default { }, }; return ( -
+
开始上传 diff --git a/components/vc-upload/demo/customRequest.js b/components/vc-upload/demo/customRequest.js index a736b54cd..9988cfec9 100644 --- a/components/vc-upload/demo/customRequest.js +++ b/components/vc-upload/demo/customRequest.js @@ -28,25 +28,29 @@ export default { // EXAMPLE: post form-data with 'axios' const formData = new FormData(); if (data) { - Object - .keys(data) - .map(key => { - formData.append(key, data[key]); - }); + Object.keys(data).map(key => { + formData.append(key, data[key]); + }); } formData.append(filename, file); - axios.post(action, formData, { - withCredentials, - headers, - onUploadProgress: ({total, loaded}) => { - onProgress({ - percent: Math.round((loaded / total) * 100).toFixed(2), - }, file); - }, - }).then(({data: response}) => { - onSuccess(response, file); - }).catch(onError); + axios + .post(action, formData, { + withCredentials, + headers, + onUploadProgress: ({ total, loaded }) => { + onProgress( + { + percent: Math.round((loaded / total) * 100).toFixed(2), + }, + file, + ); + }, + }) + .then(({ data: response }) => { + onSuccess(response, file); + }) + .catch(onError); return { abort() { @@ -65,17 +69,17 @@ export default { error(err) { console.log('error', err); }, - progress({ - percent, - }, file) { + progress({ percent }, file) { console.log('progress', `${percent}%`, file.name); }, }, }; return ( -
+
开始上传 diff --git a/components/vc-upload/demo/drag.jsx b/components/vc-upload/demo/drag.jsx index 6eb857b30..17e93f8bd 100644 --- a/components/vc-upload/demo/drag.jsx +++ b/components/vc-upload/demo/drag.jsx @@ -36,6 +36,6 @@ export default { background: '#eee', }, }; - return ; + return ; }, }; diff --git a/components/vc-upload/demo/simple.jsx b/components/vc-upload/demo/simple.jsx index 5e9a56b5f..68d9ff496 100644 --- a/components/vc-upload/demo/simple.jsx +++ b/components/vc-upload/demo/simple.jsx @@ -2,9 +2,9 @@ import Upload from '../index'; export default { data() { - return {destroyed: false}; + return { destroyed: false }; }, - methods : { + methods: { destroy() { this.destroyed = true; }, @@ -64,15 +64,14 @@ export default { opacity:0.5; `; return ( -
+

固定位置

- +
@@ -84,19 +83,23 @@ export default {
-
+ height: '200px', + overflow: 'auto', + border: '1px solid red', + }} + > +
+ display: 'inline-block', + }} + > 开始上传2