import { Component, Vue, Prop, Emit } from 'vue-property-decorator'; @Component export default class Field extends Vue { @Prop() value: any; @Prop() currentValue: any; @Prop() config: any; /** * 更新值 * @author tanxj * @param value */ @Emit('on-change') onValueChange(value: any) { return { key: this.config.key, value: value }; } @Emit('on-change') onSearchInputChange(value: any, key?: string) { return { key: key || this.config.selectKey, value: value }; } protected render() { this.config.onChange = this.config.onChange || function () { }; this.config.onBlur = this.config.onBlur || function () { }; this.config.onFocus = this.config.onFocus || function () { }; this.config.onSelectChange = this.config.onSelectChange || function () { }; switch (this.config.type) { case 'text': { return ( ); } case 'select': { return ( ); } case 'selectInput': { return ( ); } case 'password': { return ( ); } case 'inputNumber': { return ( ); } case 'textarea': { return ( ); } case 'checkbox': { return ( ); } case 'radio': { return ( ); } case 'datePicker': { return ( ); } case 'timePicker': { return ( ); } case 'switch': { return ( ); } case 'cascader': { return ( ); } case 'selectTree': { return ( ); } case 'selectTable': { return ( ); } case 'selectAdd': { return ( ); } case 'searchInput': { return ( ); } case 'radioGroup': { return ( ); } case 'searchHigh': { return ( ); } default: { return (
无当前表单类型{this.config.type}
); } } } }