index.js 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. import { FormCascaderPickerDefaultProps } from './props';
  2. import createComponent from '../createComponent';
  3. import fmtEvent from '../../_util/fmtEvent';
  4. createComponent({
  5. props: FormCascaderPickerDefaultProps,
  6. methods: {
  7. onOk: function (value, option, e) {
  8. this.emit('onChange', value);
  9. if (this.props.onOk) {
  10. this.props.onOk(value, option, fmtEvent(this.props, e));
  11. }
  12. },
  13. onPickerChange: function (value, option, e) {
  14. if (this.props.onPickerChange) {
  15. this.props.onPickerChange(value, option, fmtEvent(this.props, e));
  16. }
  17. },
  18. onVisibleChange: function (visible, e) {
  19. if (this.props.onVisibleChange) {
  20. this.props.onVisibleChange(visible, fmtEvent(this.props, e));
  21. }
  22. },
  23. onFormat: function (value, option) {
  24. if (this.props.onFormat) {
  25. return this.props.onFormat(value, option);
  26. }
  27. },
  28. onDismissPicker: function (e) {
  29. if (this.props.onCancel) {
  30. this.props.onCancel(fmtEvent(this.props, e));
  31. }
  32. },
  33. onChange: function (value, options, e) {
  34. if (this.props.onChange) {
  35. this.props.onChange(value, options, fmtEvent(this.props, e));
  36. }
  37. },
  38. },
  39. });