File tree Expand file tree Collapse file tree 2 files changed +49
-0
lines changed Expand file tree Collapse file tree 2 files changed +49
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,12 @@ export default defineConfig({
36
36
{ text : 'Custom validators' , link : '/guide/customization/custom-validators' }
37
37
]
38
38
} ,
39
+ {
40
+ text : 'Components' ,
41
+ items : [
42
+ { text : 'FormLabel' , link : '/guide/components/FormLabel' } ,
43
+ ]
44
+ } ,
39
45
{
40
46
text : 'Composables' ,
41
47
items : [
Original file line number Diff line number Diff line change
1
+ ---
2
+ outline : [2,3]
3
+ ---
4
+ # FormLabel <Badge type =" tip " text =" >=2.7.0 " />
5
+ > A label component that automatically handles the labelIcon property and position.
6
+
7
+ ## Usage
8
+ ::: code-group
9
+ ``` vue [template]
10
+ <template>
11
+ <FormLabel
12
+ :label-icon="labelIcon"
13
+ :label-icon-position="labelIconPosition"
14
+ :label="field.label"
15
+ :field-id="props.id"
16
+ />
17
+ </template>
18
+ ```
19
+ ``` vue [script setup]
20
+ <script setup>
21
+ import { toRefs } from 'vue'
22
+ import { FormLabel, useLabelIcon, useFieldProps } from '@kevinkosterr/vue3-form-generator'
23
+
24
+ const props = defineProps(useFieldProps())
25
+
26
+ const { field, model } = toRefs(props)
27
+ const { labelIcon, labelIconPosition } = useLabelIcon(field.value.labelIcon)
28
+ </script>
29
+ ```
30
+ :::
31
+
32
+ ## Props
33
+ ### ` labelIcon ` <Badge type =" info " text =" string | ComponentPublicInstance | null " />
34
+ Either a string webfont class, a component or ` LabelIconDefinition ` .
35
+
36
+ ### ` labelIconPosition ` <Badge type =" info " text =" 'left' | 'right' | null " />
37
+ Either ` 'left' ` , ` 'right' ` or ` null `
38
+
39
+ ### ` label ` <Badge type =" info " text =" string " />
40
+ Label as set by the field schema.
41
+
42
+ ### ` fieldId ` <Badge type =" info " text =" string " />
43
+ Computed field id, taken from props.
You can’t perform that action at this time.
0 commit comments