NavBar 导航栏
import { NavBar, Wrapper } from "@finalx/components";
interface IProps {}
export const Index: FC<IProps> = () => {
return (
<Wrapper>
<NavBar title='导航栏标题' showBack onBack={() => console.log("on back")} />
</Wrapper>
);
};
属性
属性名 | 类型 | 默认值 | 必填 | 描述 |
---|---|---|---|---|
title | string | null | ReactElement | - | 否 | 导航栏居中的标题 |
theme | "dark" | "light" | "dark" | 否 | 导航栏的主题(黑背景白字、白背景黑字) |
icon | ReactElement | - | 否 | 图标的组件元素 |
showBack | boolean | true | 否 | 是否显示返回按钮 |
scrollShow | boolean | false | 否 | 滚动的时候是否显示标题 |
style | CSSProperties | - | 否 | 自定义根组件样式 |
scrollStyle | CSSProperties | - | 否 | 自定义滚动中的样式 |
事件
属性名 | 参数 | 必填 | 描述 |
---|---|---|---|
onBack | - | 否 | 返回事件 |