index.js 636 B

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