ratiw / vuetable-2-tutorial

MIT License
258 stars 67 forks source link

Pagination doesn't work in I use it directly in laravel view #111

Open vedmant opened 5 years ago

vedmant commented 5 years ago

Hi, I'm trying this package and have a problem with pagination, it doesn't show.

Here is my code:

<div>
  <vuetable ref="vuetable" :fields="['full_message', 'created_at', 'read_at']" api-url="{{ request()->url() }}"></vuetable>
  <vuetable-pagination ref="pagination"></vuetable-pagination>
</div>

It's inside blade template, not a vue component.

I added components to vue, they are loaded without errors:

Vue.component('vuetable', require('vuetable-2/src/components/Vuetable'))
Vue.component('vuetable-pagination', require('vuetable-2/src/components/VuetablePagination'))

It makes hxr request and gets following data:

current_page: 1
data: [{id: "942b804f-1f57-4c20-a091-b538b8fe798f", type: "App\Notifications\NewMessage",…},…]
first_page_url: "http://localhost:8000/account/notifications"
from: 1
last_page: 3
last_page_url: "http://localhost:8000/account/notifications?page=3"
next_page_url: "http://localhost:8000/account/notifications?page=2"
path: "http://localhost:8000/account/notifications"
per_page: "10"
prev_page_url: null
to: 10
total: 29

It renders table normally, but there is no pagination.

Package version is: 1.7.5

ratiw commented 5 years ago

@vedmant You'll need to set :pagination-path="".

shadowspade commented 3 months ago

I have the same issue, except that it renders the data, paginatinon meta, links and urls and has the buttons, but the next, prev buttons do not work. I have set :pagination-path=""

image

image

when i print the page onChnagePage it prints the correct page.

image

image