From 51b20c8b1322bb8dab7059823ffc4c2fd3272237 Mon Sep 17 00:00:00 2001 From: zmc <zmc_li@foxmail.com> Date: 星期一, 18 十二月 2023 17:32:46 +0800 Subject: [PATCH] 增加用户信息表的数据展示 --- 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