แก้ paging

This commit is contained in:
setthawutttty 2024-11-05 10:41:17 +07:00
parent 82593ccc94
commit 9416583d33

View file

@ -153,12 +153,6 @@ function closeModal() {
modalOrder.value = false;
rowsOrder.value = [];
}
watch(
() => pagination.value.rowsPerPage,
async () => {
await getData();
}
);
onMounted(async () => {
await getData();
@ -235,7 +229,6 @@ onMounted(async () => {
dense
v-model:pagination="pagination"
:rows-per-page-options="[10, 25, 50, 100]"
@update:pagination="updatePagination"
>
<template v-slot:header="props">
<q-tr :props="props">
@ -291,11 +284,7 @@ onMounted(async () => {
</q-td>
<q-td v-for="col in props.cols" :key="col.name" :props="props">
<div v-if="col.name == 'no'">
{{
(pagination.page - 1) * pagination.rowsPerPage +
props.rowIndex +
1
}}
{{ props.rowIndex + 1 }}
</div>
<div v-else-if="col.name == 'status'">
{{ props.row.status ? convertText(props.row.status) : "-" }}
@ -307,20 +296,6 @@ onMounted(async () => {
</q-td>
</q-tr>
</template>
<template v-slot:pagination="scope">
งหมด {{ total }} รายการ
<q-pagination
v-model="pagination.page"
active-color="primary"
color="dark"
:max="Number(totalList)"
size="sm"
boundary-links
direction-links
:max-pages="5"
@update:model-value="getData"
></q-pagination>
</template>
</d-table>
</div>
</div>