Skip to content

Commit

Permalink
fix: simply set value in unique row mode
Browse files Browse the repository at this point in the history
  • Loading branch information
pirhoo committed Jul 18, 2024
1 parent 0f3f559 commit 6202b1b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/components/TinyPagination.vue
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,12 @@ watch(() => props.modelValue, (value) => {
// Update currentPageInput value based on totalRows
currentPageInput.value = props.totalRows ? +value : 0
// Determine the row offset based on the perPage value.
const rowOffset = props.perPage === 1 ? 0 : 1
// Update currentRowInput value based on totalRows and calculated rowOffset
currentRowInput.value = props.totalRows ? +props.perPage * (+value - 1) + rowOffset : 0
if (props.perPage === 1) {
currentRowInput.value = +value
} else {
// Update currentRowInput value based on totalRows and calculated rowOffset
currentRowInput.value = props.totalRows ? +props.perPage * (+value - 1) + 1 : 0
}
}, { immediate: true })
const title = computed(() => {
Expand Down

0 comments on commit 6202b1b

Please sign in to comment.