feat: 完善网址导航功能,支持搜索

This commit is contained in:
2024-09-01 17:11:20 +08:00
parent 1421865d5c
commit ef724678cb
2 changed files with 143 additions and 31 deletions

View File

@@ -1,5 +1,8 @@
/** 处理导航链接列表 */
export function formatNavLinks() {
/**
* @description 处理导航链接列表
* @param {boolean} withAll 是否添加“全部”项
*/
export function formatNavLinks(withAll = false) {
/** @type {NavLinkItem[]} */
let list0 = JSON.parse(JSON.stringify(window['NAV_LINK_LIST']));
@@ -43,6 +46,14 @@ export function formatNavLinks() {
}
})(list0, list1);
if (withAll) {
list1.unshift({
title: '全部',
icon: 'mdi mdi-view-grid',
children: JSON.parse(JSON.stringify(list1)),
});
}
return list1;
}