mirror of
https://github.com/haexhub/haex-hub.git
synced 2025-12-17 06:30:50 +01:00
switch to nuxt ui
This commit is contained in:
@ -1,22 +1,31 @@
|
||||
<template>
|
||||
<button
|
||||
class="btn join-item pointer-events-auto"
|
||||
:type
|
||||
>
|
||||
<UiTooltip
|
||||
:tooltip
|
||||
v-if="tooltip"
|
||||
>
|
||||
<slot />
|
||||
</UiTooltip>
|
||||
|
||||
<slot v-else />
|
||||
</button>
|
||||
<div>
|
||||
<UTooltip :text="buttonProps?.tooltip">
|
||||
<UButton
|
||||
class="pointer-events-auto"
|
||||
v-bind="{ ...buttonProps, ...$attrs }"
|
||||
@click="(e) => $emit('click', e)"
|
||||
>
|
||||
<template
|
||||
v-for="(_, slotName) in $slots"
|
||||
#[slotName]="slotProps"
|
||||
>
|
||||
<slot
|
||||
:name="slotName"
|
||||
v-bind="slotProps"
|
||||
/>
|
||||
</template>
|
||||
</UButton>
|
||||
</UTooltip>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
const { type = 'button' } = defineProps<{
|
||||
type?: 'reset' | 'submit' | 'button'
|
||||
import type { ButtonProps } from '@nuxt/ui'
|
||||
|
||||
interface IButtonProps extends /* @vue-ignore */ ButtonProps {
|
||||
tooltip?: string
|
||||
}>()
|
||||
}
|
||||
const buttonProps = defineProps<IButtonProps>()
|
||||
defineEmits<{ click: [Event] }>()
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user