Button.vue 815 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <template>
  2. <button
  3. :type="nativeType"
  4. :disabled="isLoading || isDisabled"
  5. :class="{
  6. 'button': true,
  7. [`${color}`]: true,
  8. 'is-loading': isLoading,
  9. }"
  10. v-on:click="$emit('click')">
  11. <slot />
  12. </button>
  13. </template>
  14. <script>
  15. export default {
  16. name: 'VButton',
  17. props: {
  18. color: {
  19. type: String,
  20. default: 'is-link'
  21. },
  22. nativeType: {
  23. type: String,
  24. default: 'submit'
  25. },
  26. isLoading: {
  27. type: Boolean,
  28. default: false
  29. },
  30. isDisabled: {
  31. type: Boolean,
  32. default: false
  33. }
  34. }
  35. }
  36. </script>