diff --git a/packages/core/client/src/pm/index.tsx b/packages/core/client/src/pm/index.tsx index 1ee0ba0cd..00db02c89 100644 --- a/packages/core/client/src/pm/index.tsx +++ b/packages/core/client/src/pm/index.tsx @@ -9,7 +9,6 @@ import { useACLRoleContext } from '../acl/ACLProvider'; import { ACLPane } from '../acl/ACLShortcut'; import { useRequest } from '../api-client'; import { CollectionManagerPane } from '../collection-manager'; -import { useDocumentTitle } from '../document-title'; import { Icon } from '../icon'; import { RouteSwitchContext } from '../route-switch'; import { useCompile } from '../schema-component'; @@ -113,7 +112,6 @@ const PluginList = (props) => { const params = useParams(); const navigate = useNavigate(); const { tabName = 'local' } = params; - const { setTitle } = useDocumentTitle(); const { t } = useTranslation(); const { snippets = [] } = useACLRoleContext(); diff --git a/packages/plugins/mobile-client/src/client/core/schema/components/header/Header.tsx b/packages/plugins/mobile-client/src/client/core/schema/components/header/Header.tsx index 3d6c145c3..cc0cb3039 100644 --- a/packages/plugins/mobile-client/src/client/core/schema/components/header/Header.tsx +++ b/packages/plugins/mobile-client/src/client/core/schema/components/header/Header.tsx @@ -1,11 +1,11 @@ import { css, cx } from '@emotion/css'; -import { SortableItem, useCompile, useDesigner } from '@nocobase/client'; +import { useField } from '@formily/react'; +import { SortableItem, useCompile, useDesigner, useDocumentTitle } from '@nocobase/client'; import { NavBar, NavBarProps } from 'antd-mobile'; import React, { useEffect } from 'react'; import { useNavigate } from 'react-router-dom'; -import { HeaderDesigner } from './Header.Designer'; -import { useField } from '@formily/react'; import { generateNTemplate } from '../../../../locale'; +import { HeaderDesigner } from './Header.Designer'; export interface HeaderProps extends NavBarProps { title?: string; @@ -18,10 +18,11 @@ const InternalHeader = (props: HeaderProps) => { const compile = useCompile(); const compiledTitle = compile(title); const navigate = useNavigate(); + const { setTitle } = useDocumentTitle(); useEffect(() => { // sync title - document.title = `${compiledTitle} - NocoBase`; + setTitle(compiledTitle); }, [compiledTitle]); return (