Sfoglia il codice sorgente

消息数据判空

yangc 7 anni fa
parent
commit
88187e9815
1 ha cambiato i file con 8 aggiunte e 6 eliminazioni
  1. 8 6
      components/mobile/center/Message.vue

+ 8 - 6
components/mobile/center/Message.vue

@@ -59,12 +59,14 @@
     watch: {
       'messageList': {
         handler: function (val) {
-          if (this.isChange) {
-            this.msgList = val.content
-            this.isChange = false
-          } else {
-            this.msgList = [...this.msgList, ...val.content]
-            this.getRead()
+          if (val) {
+            if (this.isChange) {
+              this.msgList = val.content
+              this.isChange = false
+            } else {
+              this.msgList = [...this.msgList, ...val.content]
+              this.getRead()
+            }
           }
         },
         immediate: true