Button.vue 711 B

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