refactor to ui components

This commit is contained in:
2023-05-26 16:43:12 +02:00
parent a642fcd1fb
commit c3bd807bff
13 changed files with 122 additions and 125 deletions

View File

@@ -0,0 +1,23 @@
<script setup lang="ts">
interface Props {
size?: string
variant?: 'regular' | 'outline'
color?: string
}
const props = withDefaults(defineProps<Props>(), {
size: 'md',
variant: 'regular',
color: 'regular'
})
const styleClass = computed(() => {
const sizeClass = `btn-${props.size}`
const variantClass = props.variant !== 'regular' ? `btn-${props.variant}` : ''
const colorClass = props.color !== 'regular' ? `btn-${props.color}` : ''
return [sizeClass, variantClass, colorClass]
})
</script>
<template>
<button class="btn" :class="styleClass"><slot></slot></button>
</template>