replace some el-button

This commit is contained in:
pa
2026-01-11 12:24:58 +09:00
committed by Natsumi
parent 66d8addc9f
commit 2043a321a4
34 changed files with 317 additions and 237 deletions

View File

@@ -1,6 +1,7 @@
<script setup>
import { Primitive } from 'reka-ui';
import { cn } from '@/lib/utils';
import { computed } from 'vue';
import { buttonVariants } from '.';
@@ -8,9 +9,12 @@
variant: { type: null, required: false },
size: { type: null, required: false },
class: { type: null, required: false },
disabled: { type: Boolean, required: false },
asChild: { type: Boolean, required: false },
as: { type: null, required: false, default: 'button' }
});
const isNativeButton = computed(() => props.as === 'button' && !props.asChild);
</script>
<template>
@@ -18,6 +22,9 @@
data-slot="button"
:as="as"
:as-child="asChild"
:disabled="isNativeButton ? props.disabled : undefined"
:data-disabled="props.disabled ? '' : undefined"
:aria-disabled="props.disabled || undefined"
:class="cn(buttonVariants({ variant, size }), props.class)">
<slot />
</Primitive>