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

43 lines (41 loc) 961 B
import fmtEvent from "../_util/fmtEvent"; Component({ mixins: [], data: {}, props: { className: '', size: 'medium', shape: '', defaultValue: '', value: '', onChange: null, disabled: false, dataSource: [], itemDirection: 'hoz' }, didMount() { if (this.props.defaultValue) { this.setData({ value: this.props.defaultValue }) } }, didUpdate() { // if (this.props.defaultValue != this.data.defaultValue) { // this.setData({ // value: this.props.defaultValue // }) // } }, didUnmount() { }, methods: { onChange(e) { this.setData({ value: e.detail.value }) let event = fmtEvent(this.props, e); this.props.onChange && this.props.onChange(event); }, }, });