tianyun hai 9 meses
pai
achega
44ca4b01ee
Modificáronse 1 ficheiros con 12 adicións e 10 borrados
  1. 12 10
      simple-demo/memos.html

+ 12 - 10
simple-demo/memos.html

@@ -370,10 +370,10 @@
                     if (res['list']) {
                         let resList = res['list']
                         this.searchResStr = res['res'];
-
+                        this.contentList = resList;
+                        this.searchByContent();
                     }
                 })
-
             },
             duoxuanChange() {
                 if (this.duoxuan) {
@@ -643,7 +643,7 @@
             },
             search: function () {
                 document.documentElement.scrollTo(0, 0);
-                this.resourceMap = {};
+
                 console.log(this.tagChecked);
 
                 let params = {'search': this.searchStr, tag_str: this.tagChecked.join(','), page: this.page, page_size: this.size};
@@ -654,7 +654,15 @@
                     return;
                 }
                 this.contentList = res.res;
-
+                this.searchByContent();
+            },
+            getAllTags: function () {
+                this.allTags = requestUtil.async('https://memos.tianyunperfect.cn/api/v1/tag', 'get', null, myHeaders).then(res => {
+                    this.allTags = res;
+                })
+            },
+            searchByContent: function () {
+                this.resourceMap = {};
                 // contentList 循环获取里面所有的id数组
                 let idArr = this.contentList.map(item => item['id']);
                 // 获取资源
@@ -673,12 +681,6 @@
                     }
                 });
             },
-            getAllTags: function () {
-                this.allTags = requestUtil.async('https://memos.tianyunperfect.cn/api/v1/tag', 'get', null, myHeaders).then(res => {
-                    this.allTags = res;
-                })
-
-            }
         }
     });