import { VNodeData , VNodeChildren , VNode } from 'vue' ; import { CreateElement , Field , ElementProps , InputEvent } from '../../types' ; export const CreateInput = < T extends Field < any > > ( h , tag , data , children = [ ] , event = 'input' ) : VNode => { const props = data . props as ElementProps < T > ; return h ( tag , { key : props . field . key , attrs : props . field . descriptor . attrs , on : { [ event ] ( { target } ) { props . field . setValue ( target . value ) ; } } } , children as any ) ; } ;