db 2 years ago
parent
commit
873019b576
3 changed files with 15 additions and 2 deletions
  1. 8 1
      src/App.vue
  2. 5 1
      src/views/htgj/index.vue
  3. 2 0
      src/views/htgj/search.vue

+ 8 - 1
src/App.vue

@@ -1,4 +1,11 @@
 <template>
-  <router-view />
+  <!-- <router-view /> -->
+   <router-view v-slot="{ Component }">
+    <transition>
+      <keep-alive include="htgjIndex">             
+        <component :is="Component" />
+      </keep-alive>
+    </transition>
+  </router-view>
 </template>
 

+ 5 - 1
src/views/htgj/index.vue

@@ -73,7 +73,11 @@
     </div>
   </div>
 </template>
-
+<script>
+export default {
+  name: "htgjIndex",
+};
+</script>
 <script setup>
 import { reactive, onMounted, toRefs, ref } from "vue";
 import { Icon, Tab, Tabs, List, PullRefresh } from "vant";

+ 2 - 0
src/views/htgj/search.vue

@@ -139,8 +139,10 @@ const searchHandle = () => {
 };
 /* 表单清空 */
 const clearIpt = () => {
+  searchState.searchTxt = ''
   dataState.resultList = [];
   dataState.orderColumn = "Matching";
+  console.log(searchState.searchTxt);
 };
 /* 历史搜索清空 */
 const clearHistory = () => {