mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-19 06:43:51 +02:00
feat: unify table page size handling with useVrcxVueTable
This commit is contained in:
@@ -503,6 +503,19 @@
|
||||
set: (size) => handlePageSizeChange(size)
|
||||
});
|
||||
|
||||
// When the current pageSize is not in the available pageSizes list
|
||||
watch(
|
||||
[pageSizeProxy, () => props.pageSizes],
|
||||
([current, sizes]) => {
|
||||
if (!sizes?.length || sizes.includes(current)) {
|
||||
return;
|
||||
}
|
||||
const nearest = sizes.reduce((prev, s) => (Math.abs(s - current) < Math.abs(prev - current) ? s : prev));
|
||||
handlePageSizeChange(nearest);
|
||||
},
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
const pageSizeValue = computed({
|
||||
get: () => String(pageSizeProxy.value),
|
||||
set: (value) => handlePageSizeChange(Number(value))
|
||||
|
||||
Reference in New Issue
Block a user