From c17b67e2f55ae88fd57091b71cd36a076b971c91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yi=C4=9Fit=20FINDIKLI?= Date: Thu, 23 Sep 2021 12:31:47 +0300 Subject: [PATCH] Fixed #1602 - Paginator's Inputnumber displays index instead of current page --- src/components/paginator/CurrentPageReport.vue | 6 +++++- src/components/paginator/JumpToPageInput.vue | 2 +- src/components/paginator/Paginator.vue | 9 ++++++--- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/components/paginator/CurrentPageReport.vue b/src/components/paginator/CurrentPageReport.vue index 4156a68ac6..9b51770290 100755 --- a/src/components/paginator/CurrentPageReport.vue +++ b/src/components/paginator/CurrentPageReport.vue @@ -10,6 +10,10 @@ type: Number, default: 0 }, + currentPage: { + type: Number, + default: 0 + }, page: { type: Number, default: 0 @@ -34,7 +38,7 @@ computed: { text() { let text = this.template - .replace("{currentPage}", this.pageCount > 0 ? this.page + 1 : 0) + .replace("{currentPage}", this.currentPage) .replace("{totalPages}", this.pageCount) .replace("{first}", this.pageCount > 0 ? this.first + 1 : 0) .replace("{last}", Math.min(this.first + this.rows, this.totalRecords)) diff --git a/src/components/paginator/JumpToPageInput.vue b/src/components/paginator/JumpToPageInput.vue index efc4e9e3be..579708bf8e 100644 --- a/src/components/paginator/JumpToPageInput.vue +++ b/src/components/paginator/JumpToPageInput.vue @@ -16,7 +16,7 @@ export default { }, methods: { onChange(value) { - this.$emit('page-change', value); + this.$emit('page-change', value - 1); } }, components: { diff --git a/src/components/paginator/Paginator.vue b/src/components/paginator/Paginator.vue index ee78e8b94b..48885bc46d 100755 --- a/src/components/paginator/Paginator.vue +++ b/src/components/paginator/Paginator.vue @@ -9,13 +9,13 @@ - - - +
@@ -194,6 +194,9 @@ export default { }, empty() { return this.pageCount === 0; + }, + currentPage() { + return this.pageCount > 0 ? this.page + 1 : 0; } }, components: {