Yao 66d6f4fc03
[improvement] 增加部分组件自定义样式类,方便自定义样式 (#352)
* 增加自定义样式类,并开放部分,在文档上体现

* 增加 cell 外部样式类说明

* 增加自定义样式类
2018-07-10 16:25:47 +08:00

34 lines
547 B
JavaScript

Component({
externalClasses: ['custom-class', 'theme-class'],
properties: {
checked: {
type: Boolean,
value: false
},
loading: {
type: Boolean,
value: false
},
disabled: {
type: Boolean,
value: false
}
},
methods: {
handleZanSwitchChange() {
if (this.data.loading || this.data.disabled) {
return;
}
let checked = !this.data.checked;
this.triggerEvent('change', {
checked,
loading: this.data.loading
});
}
}
});