1
0
mirror of https://github.com/ialley-workshop-open/uni-halo.git synced 2026-07-26 20:10:51 +08:00

fix: 修复分类统计显示undefined问题 #42

This commit is contained in:
小莫唐尼
2026-07-20 16:21:18 +08:00
parent de142c4729
commit 1407b58024
3 changed files with 8 additions and 5 deletions
+4 -1
View File
@@ -275,7 +275,10 @@
fieldSelector: ['spec.hideFromList=false']
})
.then(res => {
this.categoryList = res.items.sort((a, b) => {
this.categoryList = res.items.map(item=>{
item.postCount = item.postCount ?? 0
return item;
}).sort((a, b) => {
return b.postCount - a.postCount;
});