mirror of
https://github.com/woodchen-ink/md-wechat.git
synced 2025-07-18 05:32:02 +08:00
27 lines
614 B
Vue
27 lines
614 B
Vue
<script setup lang="ts">
|
|
import type { HTMLAttributes } from 'vue'
|
|
import { Primitive, type PrimitiveProps } from 'radix-vue'
|
|
import { type ButtonVariants, buttonVariants } from '.'
|
|
import { cn } from '@/lib/utils'
|
|
|
|
interface Props extends PrimitiveProps {
|
|
variant?: ButtonVariants[`variant`]
|
|
size?: ButtonVariants[`size`]
|
|
class?: HTMLAttributes[`class`]
|
|
}
|
|
|
|
const props = withDefaults(defineProps<Props>(), {
|
|
as: `button`,
|
|
})
|
|
</script>
|
|
|
|
<template>
|
|
<Primitive
|
|
:as="as"
|
|
:as-child="asChild"
|
|
:class="cn(buttonVariants({ variant, size }), props.class)"
|
|
>
|
|
<slot />
|
|
</Primitive>
|
|
</template>
|