瀏覽代碼

首页length报错处理

liusw 7 年之前
父節點
當前提交
8768989c4c
共有 1 個文件被更改,包括 5 次插入3 次删除
  1. 5 3
      components/home/floor/FloorList.vue

+ 5 - 3
components/home/floor/FloorList.vue

@@ -179,10 +179,12 @@
       },
       purchaseManListData () {
         let list = this.$store.state.applyPurchase.purchaseManList.purchaseManList.data
-        for (let i = 0; i < list.content.length; i++) {
-          this.purchaseManList.content.push(list.content[i])
+        if (list.content) {
+          for (let i = 0; i < list.content.length; i++) {
+            this.purchaseManList.content.push(list.content[i])
+          }
+          this.listTemplate = list
         }
-        this.listTemplate = list
         return list
       },
       user () {