feat: FaSelect 组件增加 class props

This commit is contained in:
Hooray
2025-02-14 18:47:02 +08:00
parent 7f98ab21b3
commit eff07c2833
4 changed files with 7 additions and 6 deletions
@@ -7,7 +7,6 @@ import { Maximize, Minimize, X } from 'lucide-vue-next'
import {
DialogClose,
DialogContent,
DialogPortal,
useForwardPropsEmits,
} from 'radix-vue'
+1 -1
View File
@@ -45,7 +45,7 @@ function handleCollaspe() {
</slot>
</div>
<div
:class="cn('main-container group relative h-[calc-size(auto,size)] p-5 transition-height after:(pointer-events-none absolute bottom-0 left-0 z-1 h-12 max-h-full w-full from-transparent to-[hsl(var(--card))] bg-gradient-to-b opacity-0 transition-opacity content-empty)', {
:class="cn('group relative h-[calc-size(auto,size)] p-5 transition-height after:(pointer-events-none absolute bottom-0 left-0 z-1 h-12 max-h-full w-full from-transparent to-[hsl(var(--card))] bg-gradient-to-b opacity-0 transition-opacity content-empty)', {
'overflow-hidden': collaspe,
'after:(opacity-100)': isCollaspe,
}, props.mainClass)" :style="{
+4 -1
View File
@@ -1,4 +1,6 @@
<script setup lang="ts">
import type { HTMLAttributes } from 'vue'
import { cn } from '@/utils'
import {
Select,
SelectContent,
@@ -19,6 +21,7 @@ const props = defineProps<{
value: string
disabled?: boolean
}[]
class?: HTMLAttributes['class']
}>()
const value = defineModel<string>()
@@ -35,7 +38,7 @@ const selectedOption = computed({
<template>
<Select v-model:model-value="value" :disabled>
<SelectTrigger class="w-[200px]">
<SelectTrigger :class="cn('w-[200px]', props.class)">
<SelectValue :placeholder="selectedOption.label" />
</SelectTrigger>
<SelectContent>
+2 -3
View File
@@ -1,4 +1,3 @@
import type { PresetOrFactory } from '@unocss/core'
import type { Theme } from 'unocss/preset-uno'
import { entriesToCss, toArray } from '@unocss/core'
import presetLegacyCompat from '@unocss/preset-legacy-compat'
@@ -106,7 +105,7 @@ export default defineConfig<Theme>({
},
presets: [
presetUno(),
presetAnimations() as PresetOrFactory<Theme>,
presetAnimations(),
presetAttributify(),
presetIcons({
extraProperties: {
@@ -118,7 +117,7 @@ export default defineConfig<Theme>({
presetScrollbar(),
presetLegacyCompat({
legacyColorSpace: true,
}) as PresetOrFactory<Theme>,
}),
],
transformers: [
transformerDirectives(),