소스 검색

下一页翻页判断

Michael Wang 4 년 전
부모
커밋
1edbf49d2d
2개의 변경된 파일8개의 추가작업 그리고 4개의 파일을 삭제
  1. 4 2
      src/components/inspect/MarkHistory.vue
  2. 4 2
      src/components/mark/MarkHistory.vue

+ 4 - 2
src/components/inspect/MarkHistory.vue

@@ -85,8 +85,10 @@ export default defineComponent({
       }
     }
     function nextPage() {
-      currentPage.value += 1;
-      updateHistoryTask({ pageNumber: currentPage.value });
+      if (store.historyTasks.length >= 10) {
+        currentPage.value += 1;
+        updateHistoryTask({ pageNumber: currentPage.value });
+      }
     }
 
     return {

+ 4 - 2
src/components/mark/MarkHistory.vue

@@ -95,8 +95,10 @@ export default defineComponent({
       }
     }
     function nextPage() {
-      currentPage.value += 1;
-      updateHistoryTask({ pageNumber: currentPage.value });
+      if (store.historyTasks.length >= 10) {
+        currentPage.value += 1;
+        updateHistoryTask({ pageNumber: currentPage.value });
+      }
     }
 
     return {