You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

30 lines
722 B

<template>
<button :class="[b(), m(type), m(size), { [m('loading')]: loading, [m('disabled')]: disabled }]" :disabled="disabled || loading">
<span v-if="loading" :class="m('spinner')"></span>
<slot />
</button>
</template>
<script setup lang="ts">
import { useNamespace } from 'bolt-ui/utils/hooks/use-namespace'
withDefaults(
defineProps<{
type?: 'primary' | 'secondary' | 'tertiary' | 'danger' | 'warning' | 'info' | 'success'
size?: 'small' | 'medium' | 'large'
loading?: boolean
disabled?: boolean
}>(),
{
type: 'primary',
size: 'medium',
loading: false,
disabled: false
}
)
const { b, m } = useNamespace('button')
defineOptions({
name: 'BoButton'
})
</script>