瀏覽代碼

fix: page cursor and pagination (#5541)

* fix: search results not displaying on first page
* fix: page cursor position stays the same between page selection
Sandhya Veludandi 2 年之前
父節點
當前提交
4e5da41d35
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      client/components/common/search-results.vue

+ 6 - 0
client/components/common/search-results.vue

@@ -105,6 +105,9 @@ export default {
       } else {
       } else {
         this.searchIsLoading = true
         this.searchIsLoading = true
       }
       }
+    },
+    results() {
+      this.cursor = 0
     }
     }
   },
   },
   mounted() {
   mounted() {
@@ -153,6 +156,9 @@ export default {
       skip() {
       skip() {
         return !this.search || this.search.length < 2
         return !this.search || this.search.length < 2
       },
       },
+      result() {
+        this.pagination = 1
+      },
       update: (data) => _.get(data, 'pages.search', {}),
       update: (data) => _.get(data, 'pages.search', {}),
       watchLoading (isLoading) {
       watchLoading (isLoading) {
         this.searchIsLoading = isLoading
         this.searchIsLoading = isLoading