Browse Source

店铺类目筛选收起时不发送请求。

yangc 8 years ago
parent
commit
ce89fe2738
1 changed files with 5 additions and 1 deletions
  1. 5 1
      components/store/CommodityList.vue

+ 5 - 1
components/store/CommodityList.vue

@@ -6,7 +6,7 @@
           <span style="line-height: 34px;">产品分类</span>
         </div>
         <div class="category-content">
-          <el-tree :data="kinds" :props="defaultProps" :default-expanded-keys="[0]" node-key="level" accordion :highlight-current="true" @current-change="handlerCurrentNode"></el-tree>
+          <el-tree :data="kinds" :props="defaultProps" :default-expanded-keys="[0]" node-key="level" accordion :highlight-current="true" @node-expand="handlerCurrentNode" @node-collapse="onNodeCollapse"></el-tree>
         </div>
       </div>
       <!-- 产品列表 -->
@@ -216,6 +216,7 @@ export default {
   methods: {
     handlerCurrentNode (data, node) {
       this.searchCode = ''
+      console.log(data)
       if (this.parentKindId === data.id) {
         this.parentKindId = 0
         this.ids = null
@@ -229,6 +230,9 @@ export default {
 
       this.pageCommodity(this.pageParams, this.ids)
     },
+    onNodeCollapse () {
+      this.parentKindId = ''
+    },
     goodsSearch (keyword) {
       this.pageParams.page = 1
       this.pageCommodity(this.pageParams, this.ids, keyword)