From c9571c465c756deedbfe424b5eab2d7591119f77 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期五, 19 五月 2023 17:04:45 +0800
Subject: [PATCH] 新增选项组件,修改组合式函数fetchData

---
 src/composables/fetchData.js |   20 +++++++++++++++++---
 1 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/src/composables/fetchData.js b/src/composables/fetchData.js
index 08c7b46..3598753 100644
--- a/src/composables/fetchData.js
+++ b/src/composables/fetchData.js
@@ -23,8 +23,22 @@
 
   // 鏁版嵁鑾峰彇
   function fetchData() {
-    fetch(currentPage, pageSize).then((res) => {
-      
-    });
+    loadStatus.value = 1;
+    fetch(currentPage.value, pageSize.value)
+      .then((pageInfo) => {
+        currentPage.value = pageInfo.currentPage;
+        totalPage.value = pageInfo.totalPage;
+        total.value = pageInfo.total;
+
+        loadStatus.value = 0;
+      })
+      .catch(() => {
+        loadStatus.value = 3;
+      })
+      .finally(() => {
+        loadStatus.value = 2;
+      });
   }
+
+  return {currentPage, totalPage, pageSize, total, loadStatus, fetchData}
 }

--
Gitblit v1.9.3