index.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /* eslint-disable @typescript-eslint/ban-ts-comment */
  2. import { ButtonDefaultProps } from './props';
  3. import fmtEvent from '../_util/fmtEvent';
  4. Component({
  5. props: ButtonDefaultProps,
  6. methods: {
  7. onTap: function (e) {
  8. var _a = this.props, onTap = _a.onTap, disabled = _a.disabled, loading = _a.loading;
  9. if (onTap && !disabled && !loading) {
  10. var event_1 = fmtEvent(this.props, e);
  11. return onTap(event_1);
  12. }
  13. },
  14. catchTap: function (e) {
  15. var _a = this.props, catchTap = _a.catchTap, disabled = _a.disabled, loading = _a.loading;
  16. if (catchTap && !disabled && !loading) {
  17. var event_2 = fmtEvent(this.props, e);
  18. return catchTap(event_2);
  19. }
  20. },
  21. onGetAuthorize: function (e) {
  22. if (this.props.onGetAuthorize) {
  23. this.props.onGetAuthorize(fmtEvent(this.props, e));
  24. }
  25. },
  26. onFollowLifestyle: function (e) {
  27. if (this.props.onFollowLifestyle) {
  28. this.props.onFollowLifestyle(fmtEvent(this.props, e));
  29. }
  30. },
  31. onError: function (e) {
  32. if (this.props.onError) {
  33. this.props.onError(fmtEvent(this.props, e));
  34. }
  35. },
  36. onGetUserInfo: function (e) {
  37. if (this.props.onGetUserInfo) {
  38. this.props.onGetUserInfo(fmtEvent(this.props, e));
  39. }
  40. },
  41. onGetPhoneNumber: function (e) {
  42. if (this.props.onGetPhoneNumber) {
  43. this.props.onGetPhoneNumber(fmtEvent(this.props, e));
  44. }
  45. },
  46. },
  47. });