|
- /*
- * @Author: 赵伟
- * @Date: 2024-04-17 14:01:46
- * @Description: 页面标题
- */
- import KFIcon from '@/components/KFIcon';
- import classNames from 'classnames';
- import React from 'react';
- import './index.less';
-
- type PageTitleProps = {
- /** 标题 */
- title: React.ReactNode;
- /** 图标 */
- tooltip?: string;
- /** 自定义类名 */
- className?: string;
- /** 自定义样式 */
- style?: React.CSSProperties;
- /** 自定义标题 */
- titleRender?: () => React.ReactNode;
- };
-
- /**
- * 页面标题
- */
- function PageTitle({ title, style, className, tooltip }: PageTitleProps) {
- return (
- <div className={classNames('kf-page-title', className)} style={style}>
- <div>{title}</div>
- {tooltip && (
- <div className="kf-page-title__tips">
- <KFIcon type="icon-tishi" font={14} />
- <span style={{ marginLeft: '8px', fontSize: '14px' }}>{tooltip}</span>
- </div>
- )}
- </div>
- );
- }
-
- export default PageTitle;
|