This commit is contained in:
Tuğçe Küçükoğlu 2023-01-16 15:22:22 +03:00
parent 6ba55cd475
commit d1488076fd
2 changed files with 10 additions and 5 deletions

View file

@ -1,5 +1,5 @@
<template>
<JTPInput ref="jtpInput" v-model="d_page" class="p-paginator-page-input" :aria-label="inputArialabel" :disabled="disabled"></JTPInput>
<JTPInput ref="jtpInput" :modelValue="d_page" class="p-paginator-page-input" :aria-label="inputArialabel" :disabled="disabled" @update:modelValue="onChange"></JTPInput>
</template>
<script>
@ -20,13 +20,18 @@ export default {
};
},
watch: {
d_page(newValue) {
this.$emit('page-change', newValue - 1);
},
page(newValue) {
this.d_page = newValue;
}
},
methods: {
onChange(value) {
if (value !== this.page) {
this.d_page = value;
this.$emit('page-change', value - 1);
}
}
},
computed: {
inputArialabel() {
return this.$primevue.config.locale.aria ? this.$primevue.config.locale.aria.jumpToPageInputLabel : undefined;