Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2dd45854c1 |
@@ -534,9 +534,21 @@
|
|||||||
container.innerHTML = '';
|
container.innerHTML = '';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
container.innerHTML = cat.subcategories.map(sub => `
|
|
||||||
<button onclick="${filterFunction}('${sub.id}')" class="px-3 py-1 rounded text-sm bg-white border text-gray-600 hover:bg-gray-100">
|
// 获取当前筛选值
|
||||||
<i class="${sub.icon} mr-1"></i>${sub.name}
|
let currentFilter = '';
|
||||||
|
if (categoryId === 'ai-models') currentFilter = modelSubcategoryFilter;
|
||||||
|
else if (categoryId === 'gpus') currentFilter = gpuSubcategoryFilter;
|
||||||
|
else if (categoryId === 'cpus') currentFilter = cpuSubcategoryFilter;
|
||||||
|
else if (categoryId === dynamicCategoryId) currentFilter = dynamicSubcategoryFilter;
|
||||||
|
|
||||||
|
container.innerHTML = `
|
||||||
|
<button onclick="${filterFunction}('')" class="px-3 py-1 rounded text-sm ${currentFilter === '' ? 'bg-indigo-600 text-white' : 'bg-white border text-gray-600 hover:bg-gray-100'}">
|
||||||
|
<i class="ri-apps-line mr-1"></i>全部
|
||||||
|
</button>
|
||||||
|
` + cat.subcategories.map(sub => `
|
||||||
|
<button onclick="${filterFunction}('${sub.id}')" class="px-3 py-1 rounded text-sm ${currentFilter === sub.id ? 'bg-indigo-600 text-white' : 'bg-white border text-gray-600 hover:bg-gray-100'}">
|
||||||
|
<i class="${sub.icon || 'ri-folder-line'} mr-1"></i>${sub.name}
|
||||||
</button>
|
</button>
|
||||||
`).join('');
|
`).join('');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user