5 changed files with 63 additions and 33 deletions
@ -1,13 +1,27 @@ |
|||||
<script setup lang="ts"> |
<script setup lang="ts"> |
||||
import type { AlertDialogActionProps } from 'reka-ui'; |
import type { AlertDialogActionProps } from 'reka-ui'; |
||||
|
|
||||
|
import type { HTMLAttributes } from 'vue'; |
||||
|
|
||||
|
import { cn } from '@vben-core/shared/utils'; |
||||
|
|
||||
|
import { reactiveOmit } from '@vueuse/core'; |
||||
import { AlertDialogAction } from 'reka-ui'; |
import { AlertDialogAction } from 'reka-ui'; |
||||
|
|
||||
const props = defineProps<AlertDialogActionProps>(); |
import { buttonVariants } from '../button'; |
||||
|
|
||||
|
const props = defineProps< |
||||
|
AlertDialogActionProps & { class?: HTMLAttributes['class'] } |
||||
|
>(); |
||||
|
|
||||
|
const delegatedProps = reactiveOmit(props, 'class'); |
||||
</script> |
</script> |
||||
|
|
||||
<template> |
<template> |
||||
<AlertDialogAction v-bind="props"> |
<AlertDialogAction |
||||
|
v-bind="delegatedProps" |
||||
|
:class="cn(buttonVariants({ variant: 'icon' }), props.class)" |
||||
|
> |
||||
<slot></slot> |
<slot></slot> |
||||
</AlertDialogAction> |
</AlertDialogAction> |
||||
</template> |
</template> |
||||
|
|||||
@ -1,13 +1,25 @@ |
|||||
<script setup lang="ts"> |
<script setup lang="ts"> |
||||
import type { AlertDialogCancelProps } from 'reka-ui'; |
import type { AlertDialogCancelProps } from 'reka-ui'; |
||||
|
|
||||
|
import type { HTMLAttributes } from 'vue'; |
||||
|
|
||||
|
import { cn } from '@vben-core/shared/utils'; |
||||
|
|
||||
|
import { reactiveOmit } from '@vueuse/core'; |
||||
import { AlertDialogCancel } from 'reka-ui'; |
import { AlertDialogCancel } from 'reka-ui'; |
||||
|
|
||||
const props = defineProps<AlertDialogCancelProps>(); |
const props = defineProps< |
||||
|
AlertDialogCancelProps & { class?: HTMLAttributes['class'] } |
||||
|
>(); |
||||
|
|
||||
|
const delegatedProps = reactiveOmit(props, 'class'); |
||||
</script> |
</script> |
||||
|
|
||||
<template> |
<template> |
||||
<AlertDialogCancel v-bind="props"> |
<AlertDialogCancel |
||||
|
v-bind="delegatedProps" |
||||
|
:class="cn('mt-2 sm:mt-0', props.class)" |
||||
|
> |
||||
<slot></slot> |
<slot></slot> |
||||
</AlertDialogCancel> |
</AlertDialogCancel> |
||||
</template> |
</template> |
||||
|
|||||
Loading…
Reference in new issue