File tree Expand file tree Collapse file tree 2 files changed +68
-1
lines changed Expand file tree Collapse file tree 2 files changed +68
-1
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,8 @@ export default defineConfig({
48
48
text : 'Form Generator' ,
49
49
items : [
50
50
{ text : 'Props' , link : '/guide/form-generator/props' } ,
51
- { text : 'Events' , link : '/guide/form-generator/events' }
51
+ { text : 'Events' , link : '/guide/form-generator/events' } ,
52
+ { text : 'Plugin options' , link : '/guide/form-generator/plugin-options' }
52
53
]
53
54
} ,
54
55
{
Original file line number Diff line number Diff line change
1
+ These are options you can pass to the plugin when installing it into your app.
2
+
3
+ ## Usage
4
+
5
+ ``` ts
6
+ import VueFormGenerator from ' @kevinkosterr/vue3-form-generator'
7
+
8
+ app .use (
9
+ VueFormGenerator ,
10
+ {} // Your options go here.
11
+ )
12
+ ```
13
+
14
+ ## ` aliases `
15
+ > An object where the component names are the keys and their aliases are its values.
16
+ ``` ts
17
+ {
18
+ aliases : {
19
+ ' FieldText' : ' FieldTextInput'
20
+ }
21
+ }
22
+ ```
23
+ When defining something like this, the ` type ` inside a schema changes to everything
24
+ after ` "Field" ` , so in this example a new schema would look like this:
25
+ ``` ts
26
+ {
27
+ type : ' textinput' ,
28
+ // Other code...
29
+ }
30
+ ```
31
+
32
+ ## ` components `
33
+ > An array of objects with two properties, ` name ` and ` component ` where name is the name of the component (must start with ` "Field" ` )
34
+ > and component is the component instance.
35
+ ``` ts
36
+ import FieldTest from ' @/components/FieldTest.vue'
37
+
38
+ {
39
+ components : [
40
+ {
41
+ name: ' FieldTest' ,
42
+ component: FieldTest
43
+ }
44
+ ]
45
+ }
46
+ ```
47
+
48
+ ## ` excludedComponents `
49
+ > An array of field component names to exclude from the global components, this makes it
50
+ > so the components can't be used inside your forms.
51
+ ``` ts
52
+ {
53
+ excludedComponents : [ ' FieldObject' , ' FieldNumber' ]
54
+ }
55
+ ```
56
+
57
+ ## ` messages `
58
+ > An object where the keys are the validator function names and the values its error messages.
59
+ > This is for showing specific messages for your custom or existing components.
60
+ ``` ts
61
+ {
62
+ messages : {
63
+ ' yourcustomvalidator' : ' This is not valid, man!'
64
+ }
65
+ }
66
+ ```
You can’t perform that action at this time.
0 commit comments