Browse Source

解决品牌详情左侧类目页面刷新数据重复的问题。

yangc 8 years ago
parent
commit
f6d658b7db
1 changed files with 7 additions and 1 deletions
  1. 7 1
      components/product/brand/CategoriesList.vue

+ 7 - 1
components/product/brand/CategoriesList.vue

@@ -21,6 +21,12 @@
         if (!brands || brands.length === 0) {
           return []
         }
+        // 初始化去除重复数据
+        for (let i = 0; i < brands.length; i++) {
+          for (let j = 0; j < brands[i].length; j++) {
+            brands[i][j].children = []
+          }
+        }
 
         // 处理第1层
         if ((brands[0] && brands[0].length > 0) && (brands[1] && brands[1].length > 0)) {
@@ -66,7 +72,7 @@
             }
           }
         }
-        console.log(brands)
+ //       console.log(brands)
         return brands[0] || []
       },
       brand () {