index.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. 'use strict';
  2. Object.defineProperty(exports, '__esModule', { value: true });
  3. var component_1 = require('../common/component');
  4. var button_1 = require('../mixins/button');
  5. var open_type_1 = require('../mixins/open-type');
  6. var version_1 = require('../common/version');
  7. var mixins = [button_1.button, open_type_1.openType];
  8. if (version_1.canIUseFormFieldButton()) {
  9. mixins.push('wx://form-field-button');
  10. }
  11. component_1.VantComponent({
  12. mixins: mixins,
  13. classes: ['hover-class', 'loading-class'],
  14. data: {
  15. baseStyle: '',
  16. },
  17. props: {
  18. formType: String,
  19. icon: String,
  20. classPrefix: {
  21. type: String,
  22. value: 'van-icon',
  23. },
  24. plain: Boolean,
  25. block: Boolean,
  26. round: Boolean,
  27. square: Boolean,
  28. loading: Boolean,
  29. hairline: Boolean,
  30. disabled: Boolean,
  31. loadingText: String,
  32. customStyle: String,
  33. loadingType: {
  34. type: String,
  35. value: 'circular',
  36. },
  37. type: {
  38. type: String,
  39. value: 'default',
  40. },
  41. dataset: null,
  42. size: {
  43. type: String,
  44. value: 'normal',
  45. },
  46. loadingSize: {
  47. type: String,
  48. value: '20px',
  49. },
  50. color: String,
  51. },
  52. methods: {
  53. onClick: function () {
  54. if (!this.data.loading) {
  55. this.$emit('click');
  56. }
  57. },
  58. noop: function () {},
  59. },
  60. });