Skip to content

Commit

Permalink
fix: set page title error
Browse files Browse the repository at this point in the history
fix: set page title error
  • Loading branch information
xiaohuoni authored Sep 7, 2023
2 parents e282277 + ded7037 commit 1ef3e03
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/friendly-needles-raise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@alita/plugins': patch
---

fix: set page title no work
2 changes: 2 additions & 0 deletions examples/alita2/src/pages/settings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ const SettingsPage: FC<PageProps> = ({ settings, dispatch, location }) => {
navBar: {
pageBackground: '#000000',
onLeftClick,
hideNavBar: true,
pageTitle: '你好1',
rightContent: [
<Icon key="0" type="search" style={{ marginRight: '16px' }} />,
<Icon key="1" type="ellipsis" />,
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/templates/mobile-layout/layout.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ const AlitaLayout: FC<AlitaLayoutProps> = ({
);
const isTabsApp = list.length > 0;
const titleListItem = checkTitleList(pathname, titleList);
const realTitle = titleListItem || pageTitle || documentTitle || '';
const realTitle = realNavBar?.pageTitle || titleListItem || pageTitle || documentTitle || '';

// 头部永久固定,部分页面需要跟随页面流滚动,可以选择隐藏 NavBar,在页面中手动添加
const headFixed = realNavBar.fixed;
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/templates/mobile-layout/layout5.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ const AlitaLayout: FC<AlitaLayoutProps> = ({
);
const isTabsApp = list.length > 0;
const titleListItem = checkTitleList(pathname, titleList);
const realTitle = titleListItem || pageTitle || documentTitle || '';
const realTitle = realNavBar?.pageTitle || titleListItem || pageTitle || documentTitle || '';

// 头部永久固定,部分页面需要跟随页面流滚动,可以选择隐藏 NavBar,在页面中手动添加
const headFixed = realNavBar.fixed;
Expand Down

0 comments on commit 1ef3e03

Please sign in to comment.