import React, { useMemo } from 'react'; import Wrap from '../wrap/Wrap'; import Icon from '../../Icon/index'; import '../g.scss'; function ClickButton(props: IButtonAdd) { const { title = '', change, wrapStyle = { padding: '6px 20px 6px 20px' }, type, showIcon = true, disabled = false, disabledStyle = { cursor: 'not-allowed', background: '#181A1F', color: '#787E84' }, isError = false } = props; const Dom = useMemo(() => { return (
{ if (!disabled) { change?.(title, 'clickButton'); } }} > {type === 'addBtn' && showIcon ? : <>} {title}
{isError && disabled ? (

* 内置轮廓暂不支持修改静态数据

) : ( <> )}
); }, [title, type, disabled]); return Dom; } export default ClickButton; export interface IButtonAdd { title?: string | number; change?: Function; wrapStyle?: React.CSSProperties; type?: string; disabled?: boolean; showIcon?: boolean; disabledStyle?: React.CSSProperties; isError?: boolean; }