Skip to content

Commit 63fbed0

Browse files
committed
style: prettier
1 parent 0a0a6a6 commit 63fbed0

File tree

4 files changed

+53
-44
lines changed

4 files changed

+53
-44
lines changed

components/vc-upload/demo/beforeUpload.jsx

+5-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@ export default {
3030
},
3131
};
3232
return (
33-
<div style={{
34-
margin: '100px',
35-
}}>
33+
<div
34+
style={{
35+
margin: '100px',
36+
}}
37+
>
3638
<div>
3739
<Upload {...uploaderProps}>
3840
<a>开始上传</a>

components/vc-upload/demo/customRequest.js

+26-22
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,29 @@ export default {
2828
// EXAMPLE: post form-data with 'axios'
2929
const formData = new FormData();
3030
if (data) {
31-
Object
32-
.keys(data)
33-
.map(key => {
34-
formData.append(key, data[key]);
35-
});
31+
Object.keys(data).map(key => {
32+
formData.append(key, data[key]);
33+
});
3634
}
3735
formData.append(filename, file);
3836

39-
axios.post(action, formData, {
40-
withCredentials,
41-
headers,
42-
onUploadProgress: ({total, loaded}) => {
43-
onProgress({
44-
percent: Math.round((loaded / total) * 100).toFixed(2),
45-
}, file);
46-
},
47-
}).then(({data: response}) => {
48-
onSuccess(response, file);
49-
}).catch(onError);
37+
axios
38+
.post(action, formData, {
39+
withCredentials,
40+
headers,
41+
onUploadProgress: ({ total, loaded }) => {
42+
onProgress(
43+
{
44+
percent: Math.round((loaded / total) * 100).toFixed(2),
45+
},
46+
file,
47+
);
48+
},
49+
})
50+
.then(({ data: response }) => {
51+
onSuccess(response, file);
52+
})
53+
.catch(onError);
5054

5155
return {
5256
abort() {
@@ -65,17 +69,17 @@ export default {
6569
error(err) {
6670
console.log('error', err);
6771
},
68-
progress({
69-
percent,
70-
}, file) {
72+
progress({ percent }, file) {
7173
console.log('progress', `${percent}%`, file.name);
7274
},
7375
},
7476
};
7577
return (
76-
<div style={{
77-
margin: '100px',
78-
}}>
78+
<div
79+
style={{
80+
margin: '100px',
81+
}}
82+
>
7983
<div>
8084
<Upload {...uploaderProps}>
8185
<a>开始上传</a>

components/vc-upload/demo/drag.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ export default {
3636
background: '#eee',
3737
},
3838
};
39-
return <Upload {...uploaderProps}/>;
39+
return <Upload {...uploaderProps} />;
4040
},
4141
};

components/vc-upload/demo/simple.jsx

+21-18
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import Upload from '../index';
22

33
export default {
44
data() {
5-
return {destroyed: false};
5+
return { destroyed: false };
66
},
7-
methods : {
7+
methods: {
88
destroy() {
99
this.destroyed = true;
1010
},
@@ -64,15 +64,14 @@ export default {
6464
opacity:0.5;
6565
`;
6666
return (
67-
<div style={{
68-
margin: '100px',
69-
}}>
67+
<div
68+
style={{
69+
margin: '100px',
70+
}}
71+
>
7072
<h2>固定位置</h2>
7173

72-
<style>
73-
{
74-
style
75-
}</style>
74+
<style>{style}</style>
7675

7776
<div>
7877
<Upload {...uploaderProps}>
@@ -84,19 +83,23 @@ export default {
8483

8584
<div
8685
style={{
87-
height: '200px',
88-
overflow: 'auto',
89-
border: '1px solid red',
90-
}}>
91-
<div style={{
92-
height: '500px',
93-
}}>
86+
height: '200px',
87+
overflow: 'auto',
88+
border: '1px solid red',
89+
}}
90+
>
91+
<div
92+
style={{
93+
height: '500px',
94+
}}
95+
>
9496
<Upload
9597
{...uploaderProps1}
9698
component="div"
9799
style={{
98-
display: 'inline-block',
99-
}}>
100+
display: 'inline-block',
101+
}}
102+
>
100103
<a>开始上传2</a>
101104
</Upload>
102105
</div>

0 commit comments

Comments
 (0)