fix(Button): props specified more than once

This commit is contained in:
Benjamin Canac
2024-10-01 15:31:18 +02:00
parent a5153d6c8d
commit 66a04add91
2 changed files with 7 additions and 1 deletions

View File

@@ -17,6 +17,11 @@ function onClick() {
Button
</UButton>
</div>
<div class="flex items-center gap-2">
<UButton to="/">
Link
</UButton>
</div>
<div class="flex items-center gap-2">
<UButton disabled>
Disabled

View File

@@ -44,6 +44,7 @@ import { useComponentIcons } from '../composables/useComponentIcons'
import { useButtonGroup } from '../composables/useButtonGroup'
import UIcon from './Icon.vue'
import ULink from './Link.vue'
import { omit } from '../utils'
import { pickLinkProps } from '../utils/link'
const props = defineProps<ButtonProps>()
@@ -92,7 +93,7 @@ const ui = computed(() => button({
:type="type"
:disabled="disabled || isLoading"
:class="ui.base({ class: [props.class, props.ui?.base] })"
v-bind="linkProps"
v-bind="omit(linkProps, ['type', 'disabled'])"
raw
@click="onClickWrapper"
>