mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-18 08:44:25 +08:00
fix the page navigation did not work correctly when clicking page numbers above 1000
This commit is contained in:
@@ -10,17 +10,17 @@
|
|||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
:icon="true"
|
:icon="true"
|
||||||
:color="isActive ? 'primary' : 'default'"
|
:color="isActive ? 'primary' : 'default'"
|
||||||
@click="currentPage = parseInt(page)"
|
@click="currentPage = key;"
|
||||||
v-if="page !== '...'"
|
v-if="isNumber(key)"
|
||||||
>
|
>
|
||||||
<span>{{ formatNumberToLocalizedNumerals(parseInt(page)) }}</span>
|
<span>{{ formatNumberToLocalizedNumerals(key) }}</span>
|
||||||
</v-btn>
|
</v-btn>
|
||||||
<v-btn variant="text"
|
<v-btn variant="text"
|
||||||
color="default"
|
color="default"
|
||||||
:density="density"
|
:density="density"
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
:icon="true"
|
:icon="true"
|
||||||
v-if="page === '...'"
|
v-if="!isNumber(key)"
|
||||||
>
|
>
|
||||||
<span>{{ page }}</span>
|
<span>{{ page }}</span>
|
||||||
<v-menu activator="parent"
|
<v-menu activator="parent"
|
||||||
@@ -30,12 +30,13 @@
|
|||||||
<v-list>
|
<v-list>
|
||||||
<v-list-item class="text-sm" :density="density">
|
<v-list-item class="text-sm" :density="density">
|
||||||
<v-list-item-title class="cursor-pointer">
|
<v-list-item-title class="cursor-pointer">
|
||||||
<v-autocomplete width="100"
|
<v-autocomplete width="110"
|
||||||
item-title="name"
|
item-title="name"
|
||||||
item-value="value"
|
item-value="value"
|
||||||
auto-select-first="exact"
|
auto-select-first
|
||||||
:density="density"
|
:density="density"
|
||||||
:items="allPages"
|
:items="allPages"
|
||||||
|
:custom-filter="customFilter"
|
||||||
:no-data-text="tt('No results')"
|
:no-data-text="tt('No results')"
|
||||||
v-model="currentPage"/>
|
v-model="currentPage"/>
|
||||||
</v-list-item-title>
|
</v-list-item-title>
|
||||||
@@ -49,10 +50,13 @@
|
|||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, computed } from 'vue';
|
import { ref, computed } from 'vue';
|
||||||
|
import type { InternalItem, FilterMatch } from 'vuetify/lib/composables/filter.d.ts';
|
||||||
|
|
||||||
import { useI18n } from '@/locales/helpers.ts';
|
import { useI18n } from '@/locales/helpers.ts';
|
||||||
|
|
||||||
import { type NameNumeralValue, keys } from '@/core/base.ts';
|
import { type NameNumeralValue, keys } from '@/core/base.ts';
|
||||||
|
|
||||||
|
import { isNumber } from '@/lib/common.ts';
|
||||||
import type { ComponentDensity } from '@/lib/ui/desktop.ts';
|
import type { ComponentDensity } from '@/lib/ui/desktop.ts';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
@@ -93,4 +97,13 @@ const currentPage = computed<number>({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function customFilter(value: string, query: string, item?: InternalItem): FilterMatch {
|
||||||
|
if (!item) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
const page = item.value as number;
|
||||||
|
return page.toString(10).includes(query);
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user