1
1
<template lang="html">
2
2
<form >
3
- <vue-form-generator :schema =" section1" :model =" model" :options =" formOptions" ></vue-form-generator>
4
- <vue-form-generator :schema="section2" :model="model" :options="formOptions"></vue-form-generator>
3
+ <vue-form-generator :schema =" schema" :model =" model" :options =" formOptions" ></vue-form-generator>
5
4
<pre>{{ model }}</pre>
6
5
</form>
7
6
</template >
@@ -15,12 +14,14 @@ export default {
15
14
model: {
16
15
name: ' Brian Blessed' ,
17
16
email: " brian@hawkman.mongo" ,
18
- more: " More" ,
19
- things: " Things" ,
20
- pref_1: ' blah'
17
+ others: {
18
+ more: " More" ,
19
+ things: " Things"
20
+ },
21
+ single: ' blah'
21
22
},
22
23
23
- section1 : {
24
+ schema : {
24
25
groups: [{
25
26
legend: " Contact Details" ,
26
27
fields: [
@@ -44,39 +45,28 @@ export default {
44
45
type: " input" ,
45
46
inputType: " text" ,
46
47
label: " More" ,
47
- model: " more"
48
+ model: " others. more"
48
49
},
49
50
{
50
51
type: " input" ,
51
52
inputType: " text" ,
52
53
label: " Things" ,
53
- model: " things"
54
+ model: " others. things"
54
55
}
55
56
]
56
57
}],
57
58
fields: [
58
59
{
59
60
type: " input" ,
60
61
inputType: " text" ,
61
- label: " Pref 1 (without group)" ,
62
- model: " pref_1"
63
- }
64
- ]
65
- },
66
-
67
- section2: {
68
- fields: [
69
- {
70
- type: " input" ,
71
- inputType: " text" ,
72
- label: " Pref 1" ,
73
- model: " pref_1"
62
+ label: " Single field (without group)" ,
63
+ model: " single"
74
64
}
75
65
]
76
66
},
77
67
78
68
formOptions: {
79
- fieldIdPrefix: ' frm1_ '
69
+ fieldIdPrefix: ' frm1- '
80
70
}
81
71
}
82
72
},
0 commit comments