@@ -9,7 +9,7 @@ div.vue-form-generator(v-if='schema != null')
99 i.icon
1010 .helpText ( v-html ='field.help' )
1111 .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" )
1313 .buttons ( v-if ='buttonVisibility(field)' )
1414 button( v-for ='btn in field.buttons' , @click ='buttonClickHandler(btn, field)' , :class ='btn.classes' ) {{ btn.label }}
1515 .hint ( v-if ='field.hint' ) {{ field.hint }}
@@ -27,7 +27,7 @@ div.vue-form-generator(v-if='schema != null')
2727 i.icon
2828 .helpText ( v-html ='field.help' )
2929 .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" )
3131 .buttons ( v-if ='buttonVisibility(field)' )
3232 button( v-for ='btn in field.buttons' , @click ='buttonClickHandler(btn, field)' , :class ='btn.classes' ) {{ btn.label }}
3333 .hint ( v-if ='field.hint' ) {{ field.hint }}
@@ -38,7 +38,7 @@ div.vue-form-generator(v-if='schema != null')
3838<script >
3939 // import Vue from "vue";
4040 import {each , isFunction , isNil , isArray , isString } from " lodash" ;
41- import getFieldID from " ./fields/abstractField " ;
41+ import { slugifyFormID } from " ./utils/schema " ;
4242
4343 // Load all fields from '../fields' folder
4444 let fieldComponents = {};
@@ -64,8 +64,6 @@ div.vue-form-generator(v-if='schema != null')
6464 export default {
6565 components: fieldComponents,
6666
67- mixins: [ getFieldID ],
68-
6967 props: {
7068 schema: Object ,
7169
@@ -343,7 +341,12 @@ div.vue-form-generator(v-if='schema != null')
343341 fieldErrors (field ) {
344342 let res = this .errors .filter (e => e .field == field);
345343 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+ }
347350 }
348351 };
349352
0 commit comments