lokyoung / vuejs-paginate

A Vue.js(v2.x+) component for creating pagination.
MIT License
779 stars 171 forks source link

its not work with ssr, not usable in nuxtjs ssr #110

Open MicroDreamIT opened 5 years ago

MicroDreamIT commented 5 years ago
[Vue warn]: The client-side rendered virtual DOM tree is not matching server-rendered 
content. This is likely caused by incorrect HTML markup, for example nesting block-level
elements inside <p>, or missing <tbody>. Bailing hydration and performing full client-side
render.

Screen-Shot-2019-08-12-at-2-31-53-AM

it has to be capable of ssr and nuxtjs as well.

dikymury commented 4 years ago

add tag client-only

MicroDreamIT commented 4 years ago

@dikymury can you please explain more detail?

genu commented 4 years ago

@MicroDreamIT https://nuxtjs.org/api/components-client-only#the-lt-client-only-gt-component

zgmrvn commented 4 years ago

@MicroDreamIT you will have to conditionally require the lib too, instead of

import Paginate from 'vuejs-paginate'

use

const Paginate = process.client ? require('vuejs-paginate') : undefined

archieDeveloper commented 4 years ago

@MicroDreamIT import the library like this: import Paginate from 'vuejs-paginate/src/components/Paginate'

Do not use client-only.

gkatsanos commented 2 years ago

@MicroDreamIT import the library like this: import Paginate from 'vuejs-paginate/src/components/Paginate'

Do not use client-only.

could you elaborate?

oscarhandsome commented 2 years ago

add tag client-only

I made the same, helped. But strange that in plugins scope in Nuxt config I used client mode, and this is doesn't help before,