Преглед изворни кода

Merge branch 'dev/v1.2.14_tsz' of jianyu/jy-docs into feature/v1.2.14

汤世哲 пре 11 месеци
родитељ
комит
a6afcbdaa5
1 измењених фајлова са 7 додато и 2 уклоњено
  1. 7 2
      jydocs-pc/src/views/Search.vue

+ 7 - 2
jydocs-pc/src/views/Search.vue

@@ -192,7 +192,12 @@ export default {
         return
       }
       try {
-        this.$router.replace(`/search?text=${this.searchQuery.text}`)
+        const currentPath = this.$route.fullPath;
+        const targetPath = `/search?text=${encodeURIComponent(this.searchQuery.text)}`;
+
+        if (currentPath !== targetPath) {
+          this.$router.replace(targetPath);
+        }
       } catch (error) {}
     },
     getSearchState: function (search) {
@@ -273,7 +278,7 @@ export default {
     onPageChange (p) {
       this.listState.pageNum = p
       this.getList()
-      scrollTargetView('.search-result-list')
+      scrollTargetView('.sort-list')
     },
     onSizeChange (size) {
       this.listState.pageSize = size