yunohost-portal/components/YButton.vue

29 lines
523 B
Vue
Raw Normal View History

2023-07-25 19:19:27 +02:00
<script setup lang="ts">
const props = withDefaults(
defineProps<{
variant?: string
type?: HTMLButtonElement['type']
block?: boolean
}>(),
{
variant: 'primary',
type: 'button',
block: false,
},
)
const variantClass = computed(() => {
return {
primary: 'btn-primary',
success: 'btn-success',
info: 'btn-info',
}[props.variant]
})
</script>
<template>
<button class="btn" :class="[variantClass, { 'btn-block': block }]">
<slot name="default" />
</button>
</template>