Button.vue 675 B

123456789101112131415161718192021222324252627282930313233
  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. <slot />
  31. </button>
  32. </template>