fix: pageing
This commit is contained in:
parent
33e7877e6e
commit
c8d061e43a
3 changed files with 13 additions and 6 deletions
|
|
@ -15,6 +15,7 @@ const props = defineProps({
|
|||
fetchData: Function,
|
||||
count: Number,
|
||||
totalList: Number,
|
||||
total: Number,
|
||||
pass: Number,
|
||||
notpass: Number,
|
||||
missed_exam: Number,
|
||||
|
|
@ -75,8 +76,8 @@ function updatePagination(newPagination: any) {
|
|||
}
|
||||
}
|
||||
|
||||
function getList(enter?: any) {
|
||||
if (enter) {
|
||||
function getList(enter?: string) {
|
||||
if (enter == "enter") {
|
||||
pagination.value.page = 1;
|
||||
props.fetchData?.();
|
||||
} else {
|
||||
|
|
@ -193,7 +194,7 @@ watch(
|
|||
placeholder="ค้นหา"
|
||||
style="max-width: 200px"
|
||||
@keydown.enter.prevent="
|
||||
nornmalData ? props.onSearch?.() : getList(true)
|
||||
nornmalData ? props.onSearch?.() : getList('enter')
|
||||
"
|
||||
>
|
||||
<template v-slot:append>
|
||||
|
|
@ -245,7 +246,7 @@ watch(
|
|||
<slot v-bind="props" name="columns"></slot>
|
||||
</template>
|
||||
<template v-if="!nornmalData" v-slot:pagination="scope">
|
||||
ทั้งหมด {{ props.count && props.count.toLocaleString() }} รายการ
|
||||
ทั้งหมด {{ props.total?.toLocaleString() }} รายการ
|
||||
<q-pagination
|
||||
v-model="pagination.page"
|
||||
active-color="primary"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue