diff --git a/src/App.vue b/src/App.vue index a21c8ad..e3fc21c 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,12 +1,13 @@ + diff --git a/src/components/MyButton.vue b/src/components/MyButton.vue index 07dea7f..5c2aae6 100644 --- a/src/components/MyButton.vue +++ b/src/components/MyButton.vue @@ -22,15 +22,17 @@ import { computed } from 'vue'; interface ButtonProps { disabled?: boolean + fullwidth?: boolean icon?: string loading?: boolean - size: 'sm' | 'md' | 'lg' - variant: 'primary' | 'secondary' | 'danger' + size?: 'sm' | 'md' | 'lg' + variant?: 'primary' | 'secondary' | 'danger' } const { variant = "primary", size = "md", + fullwidth = false, disabled = false, loading = false } = defineProps() @@ -39,7 +41,8 @@ const emit = defineEmits(['click']) const classes = computed(() => [ `btn--${variant}`, - `btn--${size}` + `btn--${size}`, + fullwidth && 'btn--fullwidth' ]) @@ -89,6 +92,10 @@ const classes = computed(() => [ --border-radius: 0.5rem; } + &.btn--fullwidth { + width: 100%; + } + &[aria-busy="true"] { opacity: 0.5; }