import Vue , { PropOptions } from 'vue' ; import { createDecorator } from 'vue-class-component' ; param options export function VModel ( options = { } ) { const valueKey = 'value' ; return createDecorator ( ( componentOptions , key ) => { ; ( componentOptions . props || ( ( componentOptions . props = { } ) as any ) ) [ valueKey ] = options ; ( componentOptions . computed || ( componentOptions . computed = { } ) ) [ key ] = { get ( ) { return ( this as any ) [ valueKey ] ; } , set ( this , value ) { this . $emit ( 'input' , value ) ; } , } ; } ) ; }