/* * @Author: your name * @Date: 2021-12-16 14:37:12 * @Description: * @FilePath: \zl-business\src\components\Unit\textInput\index.tsx */ import React, { useMemo } from 'react'; import Wrap from '../wrap/Wrap'; import { Switch } from 'antd'; import { returnClass } from '../unit'; import '../g.scss'; function LableSwitch(props: ILabelTextInput) { const { title = 'label', value = '', change, size = 'large', paddingSize = 'normal', wrapStyle = { padding: '6px 20px 6px 20px' }, attrKey } = props; const Dom = useMemo(() => { return (
{title}
change?.(title, checked)} checked={attrKey === 'zoomEnable' ? !value : value} size="small" />
); }, [title, value, paddingSize]); return Dom; } export default LableSwitch; export interface ILabelTextInput { title?: any; value?: string | number; change?: Function; size?: string; paddingSize?: string; wrapStyle?: React.CSSProperties; attrKey?: string; }