evil-ui
Version:
[](https://www.npmjs.com/package/mini-ali-ui) [](https://github.com/Alibaba-mp/mini-ali-ui/stargaz
38 lines (36 loc) • 773 B
JavaScript
import fmtEvent from "../_util/fmtEvent";
Component({
mixins: [],
data: {
checked: false
},
props: {
className: '',
checked: null,
value: '',
id: '',
defaultChecked: false,
disabled: false,
indeterminate: null,
defaultIndeterminate: false,
onChange: null,
},
didMount() {
},
didUpdate() {
this.setData({
checked: this.props.defaultChecked
})
},
didUnmount() {
},
methods: {
onChange(e) {
this.setData({
checked: !this.data.checked
})
let event = fmtEvent(this.props, e);
this.props.onChange && this.props.onChange(event);
},
},
});