Commit f0a43912 by anyup Committed by GitHub

fix: sort the menu so that it doesn't get replaced with 999 when order=0 (#5753)

Co-authored-by: anyup <anyupxing@163.com>
1 parent b92ac5c3
......@@ -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;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!