boyjarv's avatar

Implementation of pagination on NUXT project

Can anyone help me please, I’m trying to get the plug-in Laravel-Vue-pagination working on my NUXT project, I’ll buy you a coffee!

0 likes
20 replies
boyjarv's avatar

@martinbean to implement pagination into my app, I have tried Laravel-Vue-pagination plug-in

martinbean's avatar

@boyjarv That doesn’t help any one.

Show what you’ve tried. Show any errors you’re getting. Otherwise we’re just going to tell you to read the installation docs.

boyjarv's avatar

@martinbean so I’m having issues trying to add Laravel-Vue-pagination to my NUXT app, I apparently need to register it as a component?! In the config.js file?!

boyjarv's avatar

@jlrdw it’s all going over my head, really need some help please …. Which is why I keep asking for help

martinbean's avatar

@boyjarv You’re not asking for “help” though because you’ve been unable to explain what you’ve done so far, how far you’ve gotten, and what is now blocking you progressing.

We don’t know where you are. You can’t just post, “Help me with X” and then expect people to start giving you step-by-step instructions. We need to context.

boyjarv's avatar

I don’t want to push why I have done so far as it’s broken my app?!

martinbean's avatar

@boyjarv Well how is any one supposed to help if we don’t know what you’ve done? We’re not mind readers.

martinbean's avatar

@boyjarv So include it as a component as per the accepted answer on that Stack Overflow question.

boyjarv's avatar

This is where I am stuck, how can I register it as a component in NUXT?

boyjarv's avatar

here is my plugin file:

import Vue from 'vue'
import LaravelVuePagination from 'laravel-vue-pagination'

Vue.component('laravel-vue-pagination', LaravelVuePagination)

here is my call for the component:

<LaravelVuePagination
                    :data="venues"
                    @pagination-change-page="getResults"
                    :limit="5"
                    />

I'm getting: Vue is not defined

boyjarv's avatar

Can anyone help me on this please?

kuns25's avatar

did you get the answer, I'm stuck on the same thing

kuns25's avatar

Found a solution

after installing laravel-vue-pagination, create plugins/vueLaravelPagination.js file

import Vue from 'vue'

Vue.component('pagination', require('laravel-vue-pagination'));

In nuxt.config.js add

  plugins: [
    '@/plugins/vueLaravelPagination'
  ],

and it will work like a charm

Please or to participate in this conversation.