import React from 'react'; import ProField from '@ant-design/pro-field'; import type { SwitchProps } from 'antd'; import createField from '../../BaseForm/createField'; import type { ProFormItemProps } from '../../interface'; export type ProFormSwitchProps = ProFormItemProps & { checkedChildren?: SwitchProps['checkedChildren']; unCheckedChildren?: SwitchProps['unCheckedChildren']; }; /** * @zh-cn 单选 Switch * @en-us Single Choice Switch */ const ProFormSwitch: React.FC = React.forwardRef( ({ fieldProps, unCheckedChildren, checkedChildren, proFieldProps }, ref: any) => { return ( ); }, ); export default createField(ProFormSwitch, { valuePropName: 'checked', ignoreWidth: true, });