1
0
mirror of https://gitee.com/vant-contrib/vant-weapp.git synced 2025-04-06 03:58:05 +08:00
2018-08-21 15:53:31 +08:00

28 lines
496 B
JavaScript

Component({
options: {
addGlobalClass: true
},
externalClasses: ['custom-class', 'node-class'],
properties: {
checked: Boolean,
loading: Boolean,
disabled: Boolean,
size: {
type: String,
value: '30px'
}
},
methods: {
onClick() {
if (!this.data.disabled && !this.data.loading) {
const checked = !this.data.checked;
this.triggerEvent('input', checked);
this.triggerEvent('change', checked);
}
}
}
});