Skip to content

Commit

Permalink
fix(Button): props specified more than once
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamincanac committed Oct 1, 2024
1 parent a5153d6 commit 66a04ad
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions playground/app/pages/components/button.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion src/runtime/components/Button.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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>()
Expand Down Expand Up @@ -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"
>
Expand Down

0 comments on commit 66a04ad

Please sign in to comment.