index.js 1.7 KB

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