mirror of
https://github.com/keven1024/015.git
synced 2026-05-28 16:09:37 +00:00
fix: refactor InputField component to improve attribute binding and remove unused props
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user