import React, { useRef, useEffect, useState } from 'react';
import { useSelector, useDispatch } from 'react-redux';
import styles from './style.scss';
import {
CommonItems,
} from './data';
interface Props {
visible?: boolean;
title?: string;
before?: string;
end?: string;
value?: string;
status: number;
icon: string;
className: string;
text?: string;
style?: any;
onClick?: () => void;
}
const TipTitle: React.FC<Props> = ({
visible,
title,
value,
status,
icon,
className,
text,
before,
end,
style,
onClick
}) => {
//状态控制
const [selectStatus, setSelectStatus] = useState({});
//特定属性变更后执行
useEffect(() => {
}, [props.value]);
if (visible) {
return (
<div style={style} className={`${styles.tipTitle} ${styles['tip' + className]}`}><i>{text}</i>{before ? (<span>{before}</span>) : null}<span onClick={onClick}>{title}</span>{before ? (<span>{end}</span>) : null}</div>
);
} else {
return null;
}
};
export default TipTitle;
文档更新时间: 2021-11-14 10:15 作者:admin