antd-mini
Version:
antd-mini 是支付宝小程序 UI 组件库,遵循 Ant Design 规范。
22 lines (21 loc) • 582 B
JavaScript
import mixinValue from '../mixins/value';
import { Component, triggerEvent } from '../_util/simply';
import { CheckboxDefaultProps } from './props';
Component({
props: CheckboxDefaultProps,
methods: {
onChange: function (e) {
var value = !this.getValue();
if (!this.isControlled()) {
this.update(value);
}
triggerEvent(this, 'change', value, e);
},
},
mixins: [
mixinValue({
valueKey: 'checked',
defaultValueKey: 'defaultChecked',
}),
],
});