mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
fix(projects): fix tab fixedIndex as null case
This commit is contained in:
@ -17,10 +17,10 @@ export function getAllTabs(tabs: App.Global.Tab[], homeTab?: App.Global.Tab) {
|
||||
const filterHomeTabs = tabs.filter(tab => tab.id !== homeTab.id);
|
||||
|
||||
const fixedTabs = filterHomeTabs
|
||||
.filter(tab => tab.fixedIndex !== undefined)
|
||||
.filter(tab => tab.fixedIndex !== undefined && tab.fixedIndex !== null)
|
||||
.sort((a, b) => a.fixedIndex! - b.fixedIndex!);
|
||||
|
||||
const remainTabs = filterHomeTabs.filter(tab => tab.fixedIndex === undefined);
|
||||
const remainTabs = filterHomeTabs.filter(tab => tab.fixedIndex === undefined || tab.fixedIndex === null);
|
||||
|
||||
const allTabs = [homeTab, ...fixedTabs, ...remainTabs];
|
||||
|
||||
@ -177,7 +177,7 @@ export function extractTabsByAllRoutes(router: Router, tabs: App.Global.Tab[]) {
|
||||
* @param tabs
|
||||
*/
|
||||
export function getFixedTabs(tabs: App.Global.Tab[]) {
|
||||
return tabs.filter(tab => tab.fixedIndex !== undefined);
|
||||
return tabs.filter(tab => tab.fixedIndex !== undefined && tab.fixedIndex !== null);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user