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/62/head
parent
7a0354f4a8
commit
10f252e550
|
@ -70,8 +70,8 @@ async function generateMenus(
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
// 对菜单进行排序
|
// 对菜单进行排序,避免order=0时被替换成999的问题
|
||||||
menus = menus.sort((a, b) => (a.order || 999) - (b.order || 999));
|
menus = menus.sort((a, b) => (a?.order ?? 999) - (b?.order ?? 999));
|
||||||
|
|
||||||
const finalMenus = filterTree(menus, (menu) => {
|
const finalMenus = filterTree(menus, (menu) => {
|
||||||
return !!menu.show;
|
return !!menu.show;
|
||||||
|
|
Loading…
Reference in New Issue