未验证 提交 917a8d7b 编写于 作者: H Haniel Cui 提交者: GitHub

解决 menuItemProps 的 children 可能是空数组的问题 (#6762)

* 解决 menuItemProps 的 children 可能是空数组的问题

* Update src/layouts/BasicLayout.tsx

使用 TypeScript 语法
Co-authored-by: N偏右 <afc163@gmail.com>
Co-authored-by: N偏右 <afc163@gmail.com>
上级 3249ea3c
......@@ -132,7 +132,8 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => {
)}
onCollapse={handleMenuCollapse}
menuItemRender={(menuItemProps, defaultDom) => {
if (menuItemProps.isUrl || menuItemProps.children || !menuItemProps.path) {
if (menuItemProps.isUrl || !menuItemProps.path
|| menuItemProps.children?.length) {
return defaultDom;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册