BButton.vue 669 B

12345678910111213141516171819202122232425262728
  1. <script setup lang="ts">
  2. const props = withDefaults(defineProps<{
  3. disabled: boolean
  4. type: 'primary' | 'default'
  5. }>(), {
  6. disabled: false,
  7. type: 'primary',
  8. })
  9. </script>
  10. <template>
  11. <button
  12. class="px-[60px] py-[5px] h-[47px] bg-primary border-none outline-none text-white rounded-3xl flex items-center justify-center text-lg disabled:bg-[red] after:border-none "
  13. :disabled="disabled"
  14. :class="{
  15. '!bg-disabled !text-white': disabled,
  16. 'bg-primary button-shadow': !disabled && type === 'primary',
  17. }"
  18. >
  19. <slot />
  20. </button>
  21. </template>
  22. <style scoped>
  23. .button-shadow {
  24. box-shadow: 0 4px 12px 0 rgba(69, 69, 229, 0.30);
  25. }
  26. </style>