MCPcopy Create free account
hub / github.com/baiwumm/react-admin / renderMenuDom

Function renderMenuDom

Xmw_web/src/components/BasiLayout/index.tsx:99–114  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

97 /* 自定义菜单项的 render 方法 */
98 menuItemRender: ({ icon, pro_layout_parentKeys, isUrl, path = '', locale }, defaultDom) => {
99 const renderMenuDom = () => {
100 const isGroup = LAYOUT?.siderMenuType === 'group';
101 const isCollapsed = initialState?.Collapsed;
102 return (
103 <Space size={4}>
104 {/* 分组布局不用渲染图标,避免重复 */}
105 {pro_layout_parentKeys?.length &&
106 renderMenuicon(icon)}
107 {!isGroup || (isGroup && !isCollapsed) ? (
108 <Paragraph ellipsis={{ rows: 1, tooltip: defaultDom }} style={{ marginBottom: 0 }}>
109 {isGroup ? formatMessage({ id: locale as string }) : defaultDom}
110 </Paragraph>
111 ) : null}
112 </Space>
113 );
114 };
115 return (
116 /* 渲染二级菜单图标 */
117 isUrl ? (

Callers 1

BasiLayoutFunction · 0.85

Calls 1

renderMenuiconFunction · 0.85

Tested by

no test coverage detected