头部导航栏里的菜单无法正常渲染出来的bug (#2046)

菜单循环中没有子菜单就直接返回,没有添加到arr列表中导致arr始终是空的
This commit is contained in:
zayn 2025-06-20 13:36:43 +08:00 committed by GitHub
parent f7c3d76d37
commit e58d40ab83
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 0 additions and 1 deletions

View File

@ -55,7 +55,6 @@
const deepMenus = (menus) => { const deepMenus = (menus) => {
const arr = [] const arr = []
menus?.forEach((menu) => { menus?.forEach((menu) => {
if (!menu?.children) return
if (menu.children && menu.children.length > 0) { if (menu.children && menu.children.length > 0) {
arr.push(...deepMenus(menu.children)) arr.push(...deepMenus(menu.children))
} else { } else {