11// @ts -nocheck
22import { get as objGet , forEach , isFunction , isString , isArray , debounce , uniqueId , uniq as arrayUniq } from 'lodash'
3- import validators from '../utils/validators'
4- import { slugifyFormID } from '../utils/schema'
3+ import { slugifyFormID } from '@/utils/schema'
4+ import { vAttributes } from '@/directives/vAttributes'
5+
6+ import validators from '@/utils/validators'
7+
58function convertValidator ( validator ) {
69 if ( isString ( validator ) ) {
710 if ( validators [ validator ] != null ) return validators [ validator ]
@@ -13,16 +16,6 @@ function convertValidator(validator) {
1316 return validator
1417}
1518
16- function attributesDirective ( el , binding , vnode ) {
17- let attrs = objGet ( vnode . context , 'schema.attributes' , { } )
18- let container = binding . value || 'input'
19- if ( isString ( container ) ) {
20- attrs = objGet ( attrs , container ) || attrs
21- }
22- forEach ( attrs , ( val , key ) => {
23- el . setAttribute ( key , val )
24- } )
25- }
2619export default {
2720 name : 'abstractField' ,
2821 props : [ 'vfg' , 'model' , 'schema' , 'formOptions' , 'disabled' ] ,
@@ -34,11 +27,7 @@ export default {
3427 }
3528 } ,
3629 directives : {
37- attributes : {
38- beforeMount : attributesDirective ,
39- updated : attributesDirective ,
40- componentUpdated : attributesDirective
41- }
30+ attributes : vAttributes
4231 } ,
4332 computed : {
4433 value : {
0 commit comments