12345678910111213141516171819202122232425262728293031 |
- import React from 'react';
- import { Input } from 'antd';
- import { FormItemHeight } from '../constants';
- interface IProps {
- label?: string;
- value?: string;
- disabled?: boolean;
- onChange?: (value: string) => void;
- }
- const InputFiled: React.FC<IProps> = props => {
- const { label = '标签', value, onChange, disabled } = props;
- return (
- <div className="group">
- <label>{label}</label>
- <Input
- value={value}
- style={{
- height: FormItemHeight,
- }}
- disabled={disabled}
- onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
- onChange?.(e.target.value);
- }}
- />
- </div>
- );
- };
- export default InputFiled;
|