index.js 936 B

12345678910111213141516171819202122
  1. import { ActionSheetDefaultProps } from './props';
  2. import fmtEvent from '../_util/fmtEvent';
  3. import '../_util/assert-component2';
  4. Component({
  5. props: ActionSheetDefaultProps,
  6. methods: {
  7. onAction: function (e) {
  8. var _a = e.target.dataset, item = _a.item, index = _a.index;
  9. if (item === null || item === void 0 ? void 0 : item.disabled)
  10. return;
  11. var _b = this.props, onClose = _b.onClose, onAction = _b.onAction;
  12. var event = fmtEvent(this.props, e);
  13. onClose === null || onClose === void 0 ? void 0 : onClose(event);
  14. onAction === null || onAction === void 0 ? void 0 : onAction(item, index, event);
  15. },
  16. onClose: function (e) {
  17. var onClose = this.props.onClose;
  18. var event = fmtEvent(this.props, e);
  19. onClose === null || onClose === void 0 ? void 0 : onClose(event);
  20. },
  21. },
  22. });