Maybe show some vue code for the buttons and pagination handling as well?
Oct 20, 2021
5
Level 1
Laravel Pagination with VueJS
I can retrieve data from controller using pagination, I can also display the data.
My problem is I have a custom pagination template and it has 3 divs and I can only loop inside 1 div and I can 't use my custom 'Previous & Next button'
<nav class="border-t border-gray-200 px-4 flex items-center justify-between sm:px-0" aria-label="Pagination">
<div class="-mt-px w-0 flex-1 flex">
<a href="#" class="border-t-2 border-transparent pt-4 pr-1 inline-flex items-center text-sm font-medium text-gray-500 hover:text-gray-700 hover:border-gray-200">
<ArrowNarrowLeftIcon class="mr-3 h-5 w-5 text-gray-400" aria-hidden="true" />
Previous
</a>
</div>
<div class="hidden md:-mt-px md:flex">
<Link v-for="(link, key) in links" :key="key" :href="link.url" :class="{'border-purple-500 text-purple-600 border-t-2 pt-4 px-4 inline-flex items-center text-sm font-medium': link.active}" class="border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-200 border-t-2 pt-4 px-4 inline-flex items-center text-sm font-medium">
{{link.label}}
</Link>
</div>
<div class="-mt-px w-0 flex-1 flex justify-end">
<a href="#" class="border-t-2 border-transparent pt-4 pl-1 inline-flex items-center text-sm font-medium text-gray-500 hover:text-gray-700 hover:border-gray-200">
Next
<ArrowNarrowRightIcon class="ml-3 h-5 w-5 text-gray-400" aria-hidden="true" />
</a>
</div>
</nav>
Level 1
@Sinnbeck sorry I misclicked 'Best answer', I am using the laravel pagination and since my custom pagination is just a component I just passed the links from the server.
Please or to participate in this conversation.