Laravel Pagination with VueJS
Last updated
Last updated
vue-laravel-paginex
will provide you ability to easily create pagination from Laravel Pagination object.
npm i vue-laravel-paginex
or
yarn add vue-laravel-paginex
First import the Pagination component inside your Vue component.
and define it
Then you'll be able to use pagination component.
:changePage
prop will run the function ( in our case is getData()
) when new page selected.
this.data
object must be Laravel default or API Resource Pagination object.
or
You can customize your pagination styles by overwriting default values. Available props for component:
You can use :options
prop by passing options object into it.
You have to define here only props which you want to overwrite.
You can set your own request params for request
Prop Name
Default Value
containerClass
pagination
buttonIcons
false
prevButtonClass
page-item
prevButtonText
Prev
prevButtonIcon
fa fa-chevron-left
nextButtonClass
page-item
nextButtonText
Next
nextButtonIcon
fa fa-chevron-right
numberButtonClass
page-item
numberClass
page-link
numbersCountForShow
2
activeClass
active