import { VNode } from 'vue' ; import { FieldElement } from '@/components/FieldElement' ; import { StateComponent , InputEvent } from '../../types' ; export const StateElement = { name : 'StateElement' , functional : true , render ( h , { data , props : { field } , children = [ ] } ) { return h ( FieldElement , data , [ h ( 'input' , { key : field . key , attrs : field . descriptor . attrs , on : { change : ( { target } ) => field . setValue ( target . checked ) } } ) , ... children ] ) ; } } ;