diff --git a/.changeset/friendly-needles-raise.md b/.changeset/friendly-needles-raise.md new file mode 100644 index 000000000..371999bea --- /dev/null +++ b/.changeset/friendly-needles-raise.md @@ -0,0 +1,5 @@ +--- +'@alita/plugins': patch +--- + +fix: set page title no work diff --git a/examples/alita2/src/pages/settings/index.tsx b/examples/alita2/src/pages/settings/index.tsx index 155cb5e07..dba42be07 100644 --- a/examples/alita2/src/pages/settings/index.tsx +++ b/examples/alita2/src/pages/settings/index.tsx @@ -23,6 +23,8 @@ const SettingsPage: FC = ({ settings, dispatch, location }) => { navBar: { pageBackground: '#000000', onLeftClick, + hideNavBar: true, + pageTitle: '你好1', rightContent: [ , , diff --git a/packages/plugins/templates/mobile-layout/layout.tpl b/packages/plugins/templates/mobile-layout/layout.tpl index b3b755f1d..1dbdc8f56 100644 --- a/packages/plugins/templates/mobile-layout/layout.tpl +++ b/packages/plugins/templates/mobile-layout/layout.tpl @@ -259,7 +259,7 @@ const AlitaLayout: FC = ({ ); 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; diff --git a/packages/plugins/templates/mobile-layout/layout5.tpl b/packages/plugins/templates/mobile-layout/layout5.tpl index 8acee2dd8..335a811d4 100644 --- a/packages/plugins/templates/mobile-layout/layout5.tpl +++ b/packages/plugins/templates/mobile-layout/layout5.tpl @@ -264,7 +264,7 @@ const AlitaLayout: FC = ({ ); 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;