index.js 925B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import { VantComponent } from '../common/component';
  2. import { button } from '../mixins/button';
  3. import { openType } from '../mixins/open-type';
  4. VantComponent({
  5. mixins: [button, openType],
  6. classes: ['hover-class', 'loading-class'],
  7. props: {
  8. icon: String,
  9. color: String,
  10. plain: Boolean,
  11. block: Boolean,
  12. round: Boolean,
  13. square: Boolean,
  14. loading: Boolean,
  15. hairline: Boolean,
  16. disabled: Boolean,
  17. loadingText: String,
  18. type: {
  19. type: String,
  20. value: 'default'
  21. },
  22. size: {
  23. type: String,
  24. value: 'normal'
  25. },
  26. loadingSize: {
  27. type: String,
  28. value: '20px'
  29. }
  30. },
  31. methods: {
  32. onClick() {
  33. if (!this.data.disabled && !this.data.loading) {
  34. this.$emit('click');
  35. }
  36. }
  37. }
  38. });