优化IconPicker组件,修复一些图标库图标显示不全的问题
This commit is contained in:
parent
7b5c4ca398
commit
9fecbf87cd
@ -179,6 +179,15 @@ async function loadAllIcons() {
|
||||
|
||||
if (data && data.uncategorized) {
|
||||
allIcons.value = data.uncategorized.sort()
|
||||
} else if (data && data.categories) {
|
||||
// 处理分类结构的图标库(如Carbon Icons)
|
||||
const allCategoryIcons: string[] = []
|
||||
Object.values(data.categories).forEach((categoryIcons: any) => {
|
||||
if (Array.isArray(categoryIcons)) {
|
||||
allCategoryIcons.push(...categoryIcons)
|
||||
}
|
||||
})
|
||||
allIcons.value = allCategoryIcons.sort()
|
||||
} else {
|
||||
// 如果API失败,使用预定义的常用图标列表
|
||||
allIcons.value = getFallbackIcons(config.prefix)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user