|
@@ -0,0 +1,36 @@
|
|
|
+import { FC, PropsWithChildren, ReactNode } from "react";
|
|
|
+import clsx from "clsx";
|
|
|
+import styles from "./style.module.scss";
|
|
|
+
|
|
|
+/**
|
|
|
+ * @description 自定义头部返回组件
|
|
|
+ * @param {string} title header标题
|
|
|
+ * @param {() => ReactNode} headerRender 自定义渲染
|
|
|
+ */
|
|
|
+
|
|
|
+export interface HeaderProps {
|
|
|
+ title?: string;
|
|
|
+ headerRender?: () => ReactNode;
|
|
|
+}
|
|
|
+
|
|
|
+const Header: FC<PropsWithChildren<HeaderProps>> = ({title = ''}) => {
|
|
|
+ const icon1 = clsx({
|
|
|
+ [styles.iconfontIcon1]: true,
|
|
|
+ },'iconfont icon-xiangzuo1');
|
|
|
+ const icon2 = clsx({
|
|
|
+ [styles.iconfontIcon2]: true,
|
|
|
+ },'iconfont icon-company_nav_icon_home');
|
|
|
+ return (
|
|
|
+ <div className={styles.headerBack}>
|
|
|
+ <div className={styles.left}>
|
|
|
+ <span className={icon1}></span>
|
|
|
+ </div>
|
|
|
+ <span className={styles.title}>{title}</span>
|
|
|
+ <span className={styles.right}>
|
|
|
+ <span className={icon2}></span>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ );
|
|
|
+};
|
|
|
+
|
|
|
+export default Header;
|