YButton update type prop

This commit is contained in:
axolotle 2023-08-01 16:30:36 +02:00
parent cbe3a5d641
commit 746fdafa9c

View file

@ -1,7 +1,7 @@
<script setup lang="ts"> <script setup lang="ts">
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
type?: HTMLButtonElement['type'] type?: 'button' | 'submit' | 'reset'
text?: string text?: string
variant?: string variant?: string
icon?: string icon?: string
@ -31,7 +31,11 @@ const variantClass = computed(() => {
</script> </script>
<template> <template>
<button class="btn" :class="[variantClass, { 'btn-block': block }]"> <button
class="btn"
:class="[variantClass, { 'btn-block': block }]"
:type="type"
>
<slot name="default"> <slot name="default">
<Icon v-if="icon" :name="icon" :size="iconSize" aria-hidden="true" /> <Icon v-if="icon" :name="icon" :size="iconSize" aria-hidden="true" />
<span :class="{ 'sr-only': iconOnly }">{{ text }}</span> <span :class="{ 'sr-only': iconOnly }">{{ text }}</span>