diff --git a/package.json b/package.json index a4a354e..82aeebd 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "axp-ui", "descriiption": "My helper ui lib", - "version": "1.8.7", + "version": "1.9.0", "homepage": "https://antoxahub.ru/antoxa/axp-ui", "repository": { "type": "git", diff --git a/src/components/Pagination.vue b/src/components/Pagination.vue index a6bb9ce..339a55b 100644 --- a/src/components/Pagination.vue +++ b/src/components/Pagination.vue @@ -23,8 +23,6 @@ import { Pagination } from 'axp-ts' // Props. const props = withDefaults(defineProps(), { - // @ts-ignore - modelValue: new Pagination().toObject(), length: 3 }) @@ -32,7 +30,7 @@ const props = withDefaults(defineProps(), { const emit = defineEmits() // Data. -const page = computed(() => props.modelValue.page || 1) +const page = computed(() => props.modelValue?.page || 1) const pages = computed(() => { let pages: TUiPaginationPage[] = [] @@ -53,7 +51,7 @@ const pages = computed(() => { // Next pages. for (let i = 1; i <= length; i++) { const value = page.value + i - if (value > (props.modelValue.pages || 0)) break + if (value > (props.modelValue?.pages || 0)) break pages.push({ value }) } // for(page in props.modelValue) @@ -70,13 +68,13 @@ const updateHandler = (page: number) => { const isShowFirst = computed(() => page.value - props.length > 0) const isShowLast = computed( () => - props.modelValue.pages && + props.modelValue?.pages && page.value + props.length < props.modelValue.pages )