1234567891011121314151617181920212223242526272829303132333435
  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. plain: Boolean,
  9. block: Boolean,
  10. round: Boolean,
  11. square: Boolean,
  12. loading: Boolean,
  13. disabled: Boolean,
  14. loadingText: String,
  15. type: {
  16. type: String,
  17. value: 'default'
  18. },
  19. size: {
  20. type: String,
  21. value: 'normal'
  22. },
  23. loadingSize: {
  24. type: String,
  25. value: '20px'
  26. }
  27. },
  28. methods: {
  29. onClick() {
  30. if (!this.data.disabled && !this.data.loading) {
  31. this.$emit('click');
  32. }
  33. }
  34. }
  35. });