-
Notifications
You must be signed in to change notification settings - Fork 367
/
Copy pathdemo.js
62 lines (60 loc) · 1.19 KB
/
demo.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import 'babel-polyfill';
import myUpload from '../upload-2.vue';
const Vue = window.Vue;
new Vue({
el: '#app',
data: {
show1: false,
show2: false,
show3: false,
avatarUrl1: null,
avatarUrl2: null,
avatarUrl3: null,
otherParams: {
token: '123456798',
name: 'img'
},
headers: {
smail: '*_~'
}
},
components: {
'my-upload': myUpload
},
methods: {
toggleShow1() {
let {show1} = this;
this.show1 = !show1;
},
toggleShow2() {
let {show2} = this;
this.show2 = !show2;
},
toggleShow3() {
let {show3} = this;
this.show3 = !show3;
},
cropSuccess(data, field, key) {
if (field == 'avatar1') {
this.avatarUrl1 = data;
} else if(field == 'avatar2') {
this.avatarUrl2 = data;
} else {
this.avatarUrl3 = data;
}
console.log('-------- 剪裁成功 --------');
},
cropUploadSuccess(data, field, key) {
console.log('-------- 上传成功 --------');
console.log(data);
console.log('field: ' + field);
console.log('key: ' + key);
},
cropUploadFail(status, field, key) {
console.log('-------- 上传失败 --------');
console.log(status);
console.log('field: ' + field);
console.log('key: ' + key);
}
}
});