From e8d1b5eaafc39080faa221a3ef3892317e92da64 Mon Sep 17 00:00:00 2001 From: "DESKTOP-1R2VSQH\\Lenovo ThinkPad E490" Date: Fri, 19 Jan 2024 11:22:41 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=81=E0=B8=A5=E0=B9=88=E0=B8=AD=E0=B8=87?= =?UTF-8?q?=E0=B8=82=E0=B9=89=E0=B8=AD=E0=B8=84=E0=B8=A7=E0=B8=B2=E0=B8=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Dashboard.vue | 16 +++++++++++----- src/views/MainLayout.vue | 25 +++++++++++++++++++------ 2 files changed, 30 insertions(+), 11 deletions(-) diff --git a/src/views/Dashboard.vue b/src/views/Dashboard.vue index b87b51092..0dc4838a2 100644 --- a/src/views/Dashboard.vue +++ b/src/views/Dashboard.vue @@ -32,7 +32,9 @@ onMounted(async () => { await getData(1); }); +const isLoadInbox = ref(false); const getData = async (index: number) => { + isLoadInbox.value = false; index === 1 && showLoader(); index != 0 && (await http @@ -67,6 +69,7 @@ const getData = async (index: number) => { messageError($q, e); }) .finally(() => { + isLoadInbox.value = true; hideLoader(); })); }; @@ -122,10 +125,10 @@ const totalInbox = ref(0); function onLoad(index: number, done: any) { const num = index === 1 ? 0 : index++; if (inboxList.value.length < totalInbox.value) { - setTimeout(() => { - getData(num); - done(); - }, 1000); + // setTimeout(() => { + getData(num); + done(); + // }, ); } } const thaiOptions: Intl.DateTimeFormatOptions = { @@ -225,7 +228,10 @@ const thaiOptions: Intl.DateTimeFormatOptions = { /> -