Feat: add right & bottom label in input base component
This commit is contained in:
@@ -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>
|
||||||
|
|||||||
Reference in New Issue
Block a user