เพิ่ม API รายการลา
This commit is contained in:
parent
e8bcbe5fff
commit
3546ce0ebc
3 changed files with 29 additions and 8 deletions
|
|
@ -69,12 +69,13 @@ function resetFilter() {
|
|||
filterRef.value.focus();
|
||||
}
|
||||
|
||||
function updateRowsPerPage(newPagination: any) {
|
||||
pagination.value = newPagination;
|
||||
currentPage.value = 1;
|
||||
}
|
||||
|
||||
function filterFn() {
|
||||
updatePaging(
|
||||
currentPage.value,
|
||||
Number(pagination.value.rowsPerPage),
|
||||
filter.value
|
||||
);
|
||||
updatePaging(1, Number(pagination.value.rowsPerPage), filter.value);
|
||||
}
|
||||
|
||||
function updatePaging(p: number, pS: number, key: string) {
|
||||
|
|
@ -82,7 +83,12 @@ function updatePaging(p: number, pS: number, key: string) {
|
|||
}
|
||||
|
||||
watch([() => currentPage.value, () => pagination.value.rowsPerPage], () => {
|
||||
filterFn();
|
||||
emit(
|
||||
"update:queryString",
|
||||
currentPage.value,
|
||||
Number(pagination.value.rowsPerPage),
|
||||
filter.value
|
||||
);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
@ -109,7 +115,6 @@ watch([() => currentPage.value, () => pagination.value.rowsPerPage], () => {
|
|||
ref="filterRef"
|
||||
@keydown.enter.prevent="filterFn"
|
||||
outlined
|
||||
debounce="300"
|
||||
placeholder="ค้นหา"
|
||||
style="max-width: 200px"
|
||||
class="col-xs-12 col-sm-3 col-md-2"
|
||||
|
|
@ -148,8 +153,9 @@ watch([() => currentPage.value, () => pagination.value.rowsPerPage], () => {
|
|||
virtual-scroll
|
||||
:virtual-scroll-sticky-size-start="48"
|
||||
dense
|
||||
v-model:pagination="pagination"
|
||||
:rows-per-page-options="[10, 25, 50, 100]"
|
||||
:pagination="pagination"
|
||||
@update:pagination="updateRowsPerPage"
|
||||
>
|
||||
<template v-slot:header="props">
|
||||
<q-tr :props="props">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue