diff --git a/packages/client/src/schemas/menu/index.tsx b/packages/client/src/schemas/menu/index.tsx index a231d917f..05765a568 100644 --- a/packages/client/src/schemas/menu/index.tsx +++ b/packages/client/src/schemas/menu/index.tsx @@ -72,6 +72,7 @@ import { createPortal } from 'react-dom'; import { Resource } from '../../resource'; import { useClient } from '../../constate'; import { useTranslation } from 'react-i18next'; +import { useCompile } from '../../hooks/useCompile'; export interface MenuContextProps { schema?: Schema; @@ -273,6 +274,8 @@ Menu.Divider = observer(AntdMenu.Divider); Menu.Item = observer((props: any) => { const { icon } = props; const { schema, DesignableBar } = useDesignable(); + const compile = useCompile(); + const title = compile(schema.title); return ( { @@ -292,7 +295,7 @@ Menu.Item = observer((props: any) => { )} - {schema.title} + {title} @@ -302,6 +305,8 @@ Menu.Item = observer((props: any) => { Menu.Link = observer((props: any) => { const { icon } = props; const { schema, DesignableBar } = useDesignable(); + const compile = useCompile(); + const title = compile(schema.title); return ( { @@ -321,7 +326,7 @@ Menu.Link = observer((props: any) => { )} - {schema.title} + {title} {/* {schema.title} */} @@ -333,6 +338,8 @@ Menu.Link = observer((props: any) => { Menu.URL = observer((props: any) => { const { icon } = props; const { schema, DesignableBar } = useDesignable(); + const compile = useCompile(); + const title = compile(schema.title); return ( { @@ -355,7 +362,7 @@ Menu.URL = observer((props: any) => { )} - {schema.title} + {title} @@ -369,6 +376,8 @@ Menu.Action = observer((props: any) => { const field = useField(); const [visible, setVisible] = useState(false); const { run } = useAction(); + const compile = useCompile(); + const title = compile(schema.title); return ( { - {schema.title} + {title} @@ -402,6 +411,8 @@ Menu.SubMenu = observer((props: any) => { const { icon } = props; const { schema, DesignableBar } = useDesignable(); const mode = useContext(MenuModeContext); + const compile = useCompile(); + const title = compile(schema.title); return mode === 'mix' ? ( ) : ( @@ -413,7 +424,7 @@ Menu.SubMenu = observer((props: any) => { @@ -422,7 +433,7 @@ Menu.SubMenu = observer((props: any) => { )} - {schema.title} + {title} // <>