UNPKG

evil-ui

Version:

[![npm package](https://img.shields.io/npm/v/mini-ali-ui.svg?style=flat-square)](https://www.npmjs.com/package/mini-ali-ui) [![GitHub stars](https://img.shields.io/github/stars/Alibaba-mp/mini-ali-ui.svg)](https://github.com/Alibaba-mp/mini-ali-ui/stargaz

38 lines (36 loc) 773 B
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); }, }, });