任一存 1 ano atrás
pai
commit
295c8355f1
1 arquivos alterados com 9 adições e 2 exclusões
  1. 9 2
      src/components/HotspotList.vue

+ 9 - 2
src/components/HotspotList.vue

@@ -64,7 +64,7 @@
         v-html="highlightKeyword(item.title.split('&')[0])"
       />
       <div
-        v-if="!resultList.length"
+        v-if="!resultList.length && keyword"
         class="no-data"
       >
         <img
@@ -115,9 +115,16 @@ export default {
       return tempArr
     },
   },
+  watch: {
+    hotspotData: {
+      handler(vNew) {
+        this.onClickSearch()
+      },
+      immediate: true,
+    }
+  },
   mounted() {
     this.historyList = JSON.parse(localStorage.getItem('hotspot-search-history')) || []
-    this.onClickSearch()
   },
   destroyed() {
     localStorage.setItem('hotspot-search-history', JSON.stringify(this.historyList))