Feat: add right & bottom label in input base component

This commit is contained in:
hasyim_kai
2025-11-06 08:06:01 +07:00
parent db48919325
commit 99a61a0bf2
+5 -1
View File
@@ -19,6 +19,8 @@ const props = defineProps<{
maxLength?: number maxLength?: number
isRequired?: boolean isRequired?: boolean
isDisabled?: boolean isDisabled?: boolean
rightLabel?: string
bottomLabel?: string
}>() }>()
function handleInput(event: Event) { function handleInput(event: Event) {
@@ -61,7 +63,7 @@ function handleInput(event: Event) {
v-slot="{ componentField }" v-slot="{ componentField }"
:name="fieldName" :name="fieldName"
> >
<FormItem> <FormItem :class="`relative`">
<FormControl> <FormControl>
<Input <Input
:disabled="isDisabled" :disabled="isDisabled"
@@ -76,10 +78,12 @@ function handleInput(event: Event) {
spellcheck="false" spellcheck="false"
@input="handleInput" @input="handleInput"
/> />
<p v-show="rightLabel" class="text-gray-400 absolute top-0 right-3">{{ rightLabel }}</p>
</FormControl> </FormControl>
<FormMessage /> <FormMessage />
</FormItem> </FormItem>
</FormField> </FormField>
</DE.Field> </DE.Field>
<p v-show="bottomLabel" class="text-gray-400">{{ bottomLabel }}</p>
</DE.Cell> </DE.Cell>
</template> </template>