index.js 438 B

1234567891011121314
  1. import { FormSwitchDefaultProps } from './props';
  2. import createComponent from '../createComponent';
  3. import fmtEvent from '../../_util/fmtEvent';
  4. createComponent({
  5. props: FormSwitchDefaultProps,
  6. methods: {
  7. onChange: function (value, e) {
  8. this.emit('onChange', value);
  9. if (this.props.onChange) {
  10. this.props.onChange(value, fmtEvent(this.props, e));
  11. }
  12. },
  13. }
  14. });