feat: 前端组件准备
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
<script setup lang="ts">
|
||||
import type { HTMLAttributes } from 'vue'
|
||||
import type { ButtonVariants } from '@/components/ui/button'
|
||||
import { cn } from '@/lib/utils'
|
||||
import { buttonVariants } from '@/components/ui/button'
|
||||
|
||||
const props = withDefaults(defineProps<{
|
||||
href?: string
|
||||
size?: ButtonVariants['size']
|
||||
isActive?: boolean
|
||||
class?: HTMLAttributes['class']
|
||||
}>(), {
|
||||
size: 'icon',
|
||||
isActive: false,
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<a
|
||||
:href="href"
|
||||
data-slot="pagination-link"
|
||||
:data-active="isActive ? '' : undefined"
|
||||
:aria-current="isActive ? 'page' : undefined"
|
||||
:class="cn(
|
||||
buttonVariants({
|
||||
variant: isActive ? 'outline' : 'ghost',
|
||||
size,
|
||||
}),
|
||||
'',
|
||||
props.class,
|
||||
)"
|
||||
>
|
||||
<slot />
|
||||
</a>
|
||||
</template>
|
||||
Reference in New Issue
Block a user