File tree 2 files changed +16
-4
lines changed
2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change 2
2
<form >
3
3
<vue-form-generator :schema =" section1" :model =" model" :options =" formOptions" ></vue-form-generator>
4
4
<vue-form-generator :schema="section2" :model="model" :options="formOptions"></vue-form-generator>
5
+ <pre>{{ model }}</pre>
5
6
</form>
6
7
</template >
7
8
@@ -14,6 +15,8 @@ export default {
14
15
model: {
15
16
name: ' Brian Blessed' ,
16
17
18
+ more: " More" ,
19
+ things: " Things" ,
17
20
pref_1: ' blah'
18
21
},
19
22
@@ -50,8 +53,15 @@ export default {
50
53
model: " things"
51
54
}
52
55
]
53
- }]
54
-
56
+ }],
57
+ fields: [
58
+ {
59
+ type: " input" ,
60
+ inputType: " text" ,
61
+ label: " Pref 1 (without group)" ,
62
+ model: " pref_1"
63
+ }
64
+ ]
55
65
},
56
66
57
67
section2: {
Original file line number Diff line number Diff line change @@ -151,8 +151,10 @@ div.vue-form-generator(v-if='schema != null')
151
151
152
152
beforeMount () {
153
153
// Add idPrefix to fields if fieldIdPrefix is set
154
- for (let field of this .schema .fields ) {
155
- field .idPrefix = this .options .fieldIdPrefix || " " ;
154
+ if (this .schema .fields ) {
155
+ for (let field of this .schema .fields ) {
156
+ field .idPrefix = this .options .fieldIdPrefix || " " ;
157
+ }
156
158
}
157
159
},
158
160
You can’t perform that action at this time.
0 commit comments