Skip to content

Commit b2a7b60

Browse files
committed
fix: update afcl text area component and add docs
1 parent 7785f0b commit b2a7b60

File tree

2 files changed

+38
-19
lines changed

2 files changed

+38
-19
lines changed

adminforth/documentation/docs/tutorial/03-Customization/15-afcl.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,26 @@ import { IconSearchOutline } from '@iconify-prerendered/vue-flowbite'
333333
</div>
334334
</div>
335335

336+
## Textarea
337+
<div class="split-screen" >
338+
<div >
339+
```ts
340+
import { Textarea } from '@/afcl'
341+
```
342+
343+
```ts
344+
<Textarea
345+
v-model="textAreaInput"
346+
placeholder="Enter some text..."
347+
class="w-64"
348+
/>
349+
```
350+
</div>
351+
<div>
352+
![AFCL Textarea](textarea.png)
353+
</div>
354+
</div>
355+
336356
## Tooltip
337357

338358
Wrap an element on which you would like to show a tooltip with the `Tooltip` component and add a `tooltip` slot to it.
Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,30 @@
1-
<template>
2-
3-
<textarea
4-
ref="input"
5-
class="bg-lightInputBackground border border-lightInputBorder text-lightInputText placeholder-lightInputPlaceholderText text-sm rounded-lg block w-full p-2.5 dark:bg-darkInputBackground dark:border-darkInputBorder dark:placeholder-darkInputPlaceholderText dark:text-darkInputText dark:border-darkInputBorder focus:ring-lightInputFocusRing focus:border-lightInputFocusBorder dark:focus:ring-darkInputFocusRing dark:focus:border-darkInputFocusBorder"
6-
:placeholder="placeholder"
7-
:value="modelValue"
8-
@input="$emit('update:modelValue', ($event.target as HTMLInputElement).value)"
9-
:readonly="readonly"
10-
/>
11-
1+
<template>
2+
<textarea
3+
ref="input"
4+
class="bg-lightInputBackground border border-lightInputBorder text-lightInputText placeholder-lightInputPlaceholderText text-sm rounded-lg block w-full p-2.5 dark:bg-darkInputBackground dark:border-darkInputBorder dark:placeholder-darkInputPlaceholderText dark:text-darkInputText dark:border-darkInputBorder focus:ring-lightInputFocusRing focus:border-lightInputFocusBorder dark:focus:ring-darkInputFocusRing dark:focus:border-darkInputFocusBorder"
5+
:placeholder="placeholder"
6+
:value="modelValue"
7+
@input="$emit('update:modelValue', ($event.target as HTMLTextAreaElement).value)"
8+
:readonly="readonly"
9+
/>
1210
</template>
1311

1412
<script setup lang="ts">
15-
1613
import { ref } from 'vue';
1714
1815
const props = defineProps<{
19-
modelValue: string,
20-
readonly?: boolean,
21-
placeholder?: string,
16+
modelValue: string
17+
readonly?: boolean
18+
placeholder?: string
2219
}>()
2320
24-
const input = ref<HTMLInputElement | null>(null)
21+
const emit = defineEmits<{
22+
(e: 'update:modelValue', value: string): void
23+
}>()
24+
25+
const input = ref<HTMLTextAreaElement | null>(null)
2526
2627
defineExpose({
2728
focus: () => input.value?.focus(),
28-
});
29-
29+
})
3030
</script>
31-

0 commit comments

Comments
 (0)