From b7113b658ae09f80805003dbfdb3ae8c96681200 Mon Sep 17 00:00:00 2001 From: chenos Date: Sun, 13 Nov 2022 17:17:06 +0800 Subject: [PATCH] fix(client): page title translation doesn't work resolve #838 --- .../core/client/src/schema-component/antd/page/Page.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/core/client/src/schema-component/antd/page/Page.tsx b/packages/core/client/src/schema-component/antd/page/Page.tsx index 5d306ab23..6055565eb 100644 --- a/packages/core/client/src/schema-component/antd/page/Page.tsx +++ b/packages/core/client/src/schema-component/antd/page/Page.tsx @@ -1,11 +1,13 @@ -import React, { useEffect } from 'react'; +import { useField } from '@formily/react'; import { PageHeader as AntdPageHeader } from 'antd'; -import { observer, useField } from '@formily/react'; +import React, { useEffect } from 'react'; import { useDocumentTitle } from '../../../document-title'; +import { useCompile } from '../../hooks'; export const Page = (props) => { const { children, ...others } = props; const field = useField(); + const compile = useCompile(); const { title, setTitle } = useDocumentTitle(); useEffect(() => { if (!title) { @@ -14,7 +16,7 @@ export const Page = (props) => { }, [field.title, title]); return ( <> - +
{children}
);