优化HeaderBack

master
LiuJiaNan 2025-10-28 16:13:50 +08:00
parent ad0e3b952a
commit b10ced07f7
3 changed files with 6 additions and 3 deletions

View File

@ -1,4 +1,4 @@
import type { FC, ReactNode } from "react";
import type { CSSProperties, FC, ReactNode } from "react";
export interface HeaderBackProps {
/** 标题 */
@ -10,6 +10,8 @@ export interface HeaderBackProps {
};
/** 是否显示返回按钮,默认为 true */
previous?: boolean;
/** 自定义样式 */
style?: CSSProperties;
}
/** 头部返回组件 */

View File

@ -6,10 +6,10 @@ import "./index.less";
* 头部返回组件
*/
function HeaderBack(props) {
const { title, history, previous = true } = props;
const { title, history, previous = true, style = {} } = props;
return (
<div className="header-back">
<div className="header-back" style={style}>
<div className="action">
{
previous

View File

@ -1,6 +1,7 @@
.header-back {
padding: 10px 20px;
border-bottom: 1px solid #dcdfe6;
margin-bottom: 10px;
.action {
display: flex;