vuetable-2-tutorial icon indicating copy to clipboard operation
vuetable-2-tutorial copied to clipboard

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

Open vedmant opened this issue 6 years ago • 2 comments

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

vedmant avatar Dec 07 '18 10:12 vedmant

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

ratiw avatar Dec 17 '18 14:12 ratiw