/* eslint react/no-multi-comp:0, no-console:0 */ import { createForm } from '../index'; import { Select } from 'ant-design-vue'; import { regionStyle, errorStyle } from './styles'; import { mergeProps } from '../../_util/props-util'; const emailTpl = ['@gmail.com', '@outlook.com', '@qq.com']; const { Option } = Select; const CustomInput = { props: { form: Object, }, data() { return { data: [] }; }, methods: { onChange(v) { if (v.indexOf('@') === -1) { this.data = emailTpl.map(m => v + m); } else if (this.data.length) { this.data = []; } }, }, render() { const { getFieldProps, getFieldError, isFieldValidating } = this.form; const errors = getFieldError('select'); return (
custom select sync validate
{errors ? ( errors.join(',') ) : ( 1 )}
{isFieldValidating('select') ? ( 'validating' ) : ( 1 )}
); }, }; const Form = { props: { form: Object, }, methods: { onSubmit(e) { e.preventDefault(); this.form.validateFields((error, values) => { if (!error) { console.log('ok', values); } else { console.log('error', error, values); } }); }, }, render() { const { form } = this; return (

suggest

); }, }; export default createForm()(Form);