feat(frontend): enhance SelectField and Tiptap components with improved class handling and word count display

This commit is contained in:
keven1024
2026-04-06 21:59:13 +08:00
parent a1808a64cc
commit 2af28b6a50
3 changed files with 18 additions and 11 deletions

View File

@@ -1,13 +1,5 @@
<script setup lang="ts">
import {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectLabel,
SelectTrigger,
SelectValue,
} from '@/components/ui/select'
import { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectTrigger, SelectValue } from '@/components/ui/select'
import type { RuleExpression } from 'vee-validate'
type SelectValue = string | number
const props = defineProps<{
@@ -19,13 +11,14 @@ const props = defineProps<{
label?: string
value: SelectValue
}[]
class?: string
}>()
const { value } = useField<SelectValue>(props.name, props?.rules)
</script>
<template>
<Select v-model="value">
<SelectTrigger>
<SelectTrigger :class="class">
<SelectValue :placeholder="placeholder" />
</SelectTrigger>
<SelectContent>
@@ -37,4 +30,4 @@ const { value } = useField<SelectValue>(props.name, props?.rules)
</SelectGroup>
</SelectContent>
</Select>
</template>
</template>