Browse Source

fix:分页列表滚动到第一条数据

Signed-off-by: tangshizhe <48740614+tangshizhe@users.noreply.github.com>
tangshizhe 11 months ago
parent
commit
30c50d52ac

+ 4 - 1
apps/bigmember_pc/src/components/push-list/PotentialList.vue

@@ -420,7 +420,10 @@ export default {
     onPageChange(p) {
       this.listState.pageNum = p
       this.$nextTick(() => {
-        const forMain = document.querySelector('.for_main')?.offsetTop || 0
+        let forMain = document.querySelector('.for_main')?.offsetTop || 0
+        if (forMain) {
+          forMain = forMain - 50
+        }
         scrollTargetView('.info-list', forMain)
       })
       // this.getList()

+ 3 - 0
apps/bigmember_pc/src/utils/globalFunctions.js

@@ -796,6 +796,9 @@ export function  extractKeywords(text, keywords, n = 10) {
  */
 export function scrollTargetView (targetEvent, custom) {
   if (!targetEvent) return
+  if (!custom) {
+    custom = 0
+  }
   let scrollWrapper
   let targetTop
   const inWorkSpace = location.href.indexOf('work-bench') > -1