import Input from '../../Input'; import withFormItem from '../withFormItem'; import { FieldValues } from 'react-hook-form'; import { FormItemProps } from '../Item'; import { InputProps, TextAreaProps } from 'src/components/Input/interface'; // 使用高阶组件创建FormInput const FormInput = withFormItem( Input, 'FormInput', {}, { fallbackValue: '', } ); const FormTextarea = withFormItem( Input.TextArea, 'FormTextarea', { maxLength: 100, }, { fallbackValue: '', } ); export default FormInput; export { FormTextarea }; // 导出支持泛型的类型定义 export type FormInputProps = Omit, 'children'> & InputProps; export type FormTextareaProps = Omit, 'children'> & TextAreaProps;