소스 검색

fix: 修复图库分类排序问题

小莫唐尼 8 달 전
부모
커밋
452d021816
1개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  1. 4 2
      pages/tabbar/gallery/gallery.vue

+ 4 - 2
pages/tabbar/gallery/gallery.vue

@@ -162,9 +162,11 @@ export default {
                 this.category.list = res.items.map(item => {
                     return {
                         name: item.metadata.name,
-                        displayName: item.spec.displayName
+                        displayName: item.spec.displayName,
+						priority: item.spec.priority
                     }
-                });
+                }).sort((a,b) => a.priority - b.priority);
+				
                 if (this.category.list.length !== 0) {
                     this.queryParams.group = this.category.list[0].name;
                     this.fnGetData(true);