对 antd Form组件进行二次封装,结合栅格布局,简化表单创建。
首先,你需要安装 antd 5.x 版本
| 属性 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| col | 列 | number |
4 |
| fields | 参数数组 | Fields[] |
- |
| formProps | form 参数 | FormProps |
- |
| 属性 | 说明 | 类型 | 默认值 |
|---|---|---|---|
| label | 名称 | ReactNode |
- |
| widget | 类型 | select、input、button、textarea、input_number、password、other |
- |
| colSpan | 占据空间 | number |
1 |
| widgetProps | 组件自身props | - | |
| widgetItemProps | FormItem 表单props | - | |
| widgetRender | 自定义 | () => ReactNode |
- |