Closed gassio closed 12 months ago
Hi, which event you need?
I'll add click:page
, click:next
, click:prev
as soon as possible, if you need an another event – leave a comment
Hi, I 've imported the component inside my project and I've added the event that I need. I didn't make a pull request for this yet. I send you see the changes that I made in the Pagination.vue file:
Code edited:
const emit = defineEmits(['update:modelValue', 'page-changed']); const setPage = (index: number) => { emit('update:modelValue', index) emit('page-changed', index); } const decreasePage = () => { emit('update:modelValue', props.modelValue - 1) emit('page-changed', props.modelValue - 1); } const increasePage = () => { emit('update:modelValue', props.modelValue + 1) emit('page-changed', props.modelValue + 1); }
Code added:
const goToFirstPage = () => { emit('update:modelValue', 1); emit('page-changed', 1); }
const goToLastPage = () => { const lastPage = computedTotalPages.value; emit('update:modelValue', lastPage); emit('page-changed', lastPage); }
Released in 0.0.17-next.10
Hi, Thanks for this amazing project. I want to implement pagination functionality with Vue.js. Is there any way to pass an event function to the component's props? The documentation you have does not provide any event handling options. https://flowbite-vue.com/components/pagination