@@ -9,7 +9,7 @@ div.vue-form-generator(v-if='schema != null')
9
9
i.icon
10
10
.helpText ( v-html ='field.help' )
11
11
.field-wrap
12
- component( :is ='getFieldType(field)' , :disabled ='fieldDisabled(field)' , :model ='model' , :schema ='field' , :options ='options' , @model-updated ='modelUpdated' , @validated ="onFieldValidated" )
12
+ component( :is ='getFieldType(field)' , :disabled ='fieldDisabled(field)' , :model ='model' , :schema ='field' , :formOptions ='options' , @model-updated ='modelUpdated' , @validated ="onFieldValidated" )
13
13
.buttons ( v-if ='buttonVisibility(field)' )
14
14
button( v-for ='btn in field.buttons' , @click ='buttonClickHandler(btn, field)' , :class ='btn.classes' ) {{ btn.label }}
15
15
.hint ( v-if ='field.hint' ) {{ field.hint }}
@@ -27,7 +27,7 @@ div.vue-form-generator(v-if='schema != null')
27
27
i.icon
28
28
.helpText ( v-html ='field.help' )
29
29
.field-wrap
30
- component( :is ='getFieldType(field)' , :disabled ='fieldDisabled(field)' , :model ='model' , :schema ='field' , :options ='options' ,@model-updated ='modelUpdated' , @validated ="onFieldValidated" )
30
+ component( :is ='getFieldType(field)' , :disabled ='fieldDisabled(field)' , :model ='model' , :schema ='field' , :formOptions ='options' ,@model-updated ='modelUpdated' , @validated ="onFieldValidated" )
31
31
.buttons ( v-if ='buttonVisibility(field)' )
32
32
button( v-for ='btn in field.buttons' , @click ='buttonClickHandler(btn, field)' , :class ='btn.classes' ) {{ btn.label }}
33
33
.hint ( v-if ='field.hint' ) {{ field.hint }}
@@ -38,7 +38,7 @@ div.vue-form-generator(v-if='schema != null')
38
38
<script >
39
39
// import Vue from "vue";
40
40
import {each , isFunction , isNil , isArray , isString } from " lodash" ;
41
- import getFieldID from " ./fields/abstractField " ;
41
+ import { slugifyFormID } from " ./utils/schema " ;
42
42
43
43
// Load all fields from '../fields' folder
44
44
let fieldComponents = {};
@@ -64,8 +64,6 @@ div.vue-form-generator(v-if='schema != null')
64
64
export default {
65
65
components: fieldComponents,
66
66
67
- mixins: [ getFieldID ],
68
-
69
67
props: {
70
68
schema: Object ,
71
69
@@ -343,7 +341,12 @@ div.vue-form-generator(v-if='schema != null')
343
341
fieldErrors (field ) {
344
342
let res = this .errors .filter (e => e .field == field);
345
343
return res .map (item => item .error );
346
- }
344
+ },
345
+
346
+ getFieldID (schema ) {
347
+ const idPrefix = this .options && this .options .fieldIdPrefix ? this .options .fieldIdPrefix : " " ;
348
+ return slugifyFormID (schema, idPrefix);
349
+ }
347
350
}
348
351
};
349
352
0 commit comments