แก้ไข กล่องข้อความ

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-01-17 17:34:55 +07:00
parent 94a8969d7d
commit b7de285e8d

View file

@ -87,7 +87,8 @@ onMounted(async () => {
}); });
const fetchlistInbox = async (index: number) => { const fetchlistInbox = async (index: number) => {
index === 1 && showLoader(); index === 1 && showLoader();
await http index != 0 &&
(await http
.get(config.API.msgInbox + `?page=${index}&pageSize=${10}`) .get(config.API.msgInbox + `?page=${index}&pageSize=${10}`)
.then((res) => { .then((res) => {
let data = res.data.result.data; let data = res.data.result.data;
@ -115,7 +116,7 @@ const fetchlistInbox = async (index: number) => {
}) })
.finally(() => { .finally(() => {
hideLoader(); hideLoader();
}); }));
}; };
const transferToPage = (path?: string) => { const transferToPage = (path?: string) => {
@ -149,23 +150,16 @@ function updateModalDetail(val: boolean) {
const scrollTargetRef = ref<any>(null); const scrollTargetRef = ref<any>(null);
const totalInbox = ref<number>(0); const totalInbox = ref<number>(0);
function onLoad(index: number, done: any) { async function onLoad(index: number, done: any) {
const num = index === 1 ? 0 : index++;
if (inboxList.value.length < totalInbox.value) { if (inboxList.value.length < totalInbox.value) {
setTimeout(() => { setTimeout(() => {
fetchlistInbox(index + 1); fetchlistInbox(num);
done(); done();
}, 2000); }, 2000);
} }
} }
// function onLoadRef(index: number, done: any) {
// if (inboxList.value.length < totalInbox.value) {
// setTimeout(() => {
// fetchlistInbox(index + 1);
// done();
// }, 2000);
// }
// }
</script> </script>
<template> <template>
@ -294,8 +288,11 @@ function onLoad(index: number, done: any) {
</q-item-section> </q-item-section>
</q-item> </q-item>
</div> </div>
<template v-slot:loading v-if="inboxList.length < totalInbox"> <template v-slot:loading>
<div class="row justify-center q-my-md"> <div
class="row justify-center q-my-md"
v-if="inboxList.length < totalInbox"
>
<q-spinner-dots color="primary" size="40px" /> <q-spinner-dots color="primary" size="40px" />
</div> </div>
</template> </template>