fix: refactor InputField component to improve attribute binding and remove unused props

This commit is contained in:
keven1024
2025-07-07 15:23:20 +08:00
parent 338e22dfca
commit 3d88c68ed5

View File

@@ -1,17 +1,15 @@
<template>
<Field :name="props.name" v-slot="{ field }">
<div class="flex flex-col gap-2">
<Label v-if="props.label">{{ props.label }}</Label>
<Input v-bind="field" :placeholder="props.placeholder" :class="props.class" />
</div>
</Field>
<Field :name="props.name" v-slot="{ field }">
<div class="flex flex-col gap-2">
<Label v-if="props.label">{{ props.label }}</Label>
<Input v-bind="{ ...field, ...$attrs }" />
</div>
</Field>
</template>
<script setup lang="ts">
import { Input } from '@/components/ui/input'
const props = defineProps<{
name: string
label?: string
placeholder?: string
class?: string
name: string
label?: string
}>()
</script>