Browse Source
fix: sort the menu so that it doesn't get replaced with 999 when order=0 (#5753)
Co-authored-by: anyup <anyupxing@163.com>
pull/5756/head
anyup
11 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
2 additions and
2 deletions
-
packages/utils/src/helpers/generate-menus.ts
|
|
|
@ -69,8 +69,8 @@ async function generateMenus( |
|
|
|
}; |
|
|
|
}); |
|
|
|
|
|
|
|
// 对菜单进行排序
|
|
|
|
menus = menus.sort((a, b) => (a.order || 999) - (b.order || 999)); |
|
|
|
// 对菜单进行排序,避免order=0时被替换成999的问题
|
|
|
|
menus = menus.sort((a, b) => (a?.order ?? 999) - (b?.order ?? 999)); |
|
|
|
|
|
|
|
const finalMenus = filterTree(menus, (menu) => { |
|
|
|
return !!menu.show; |
|
|
|
|