Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working in Nuxtjs Production Mode #266

Open
umardraz opened this issue Oct 21, 2019 · 5 comments
Open

Not working in Nuxtjs Production Mode #266

umardraz opened this issue Oct 21, 2019 · 5 comments

Comments

@umardraz
Copy link

The plugin is not working in Nuxtjs production mode, would you please help me how we can achieve this.

@monisnap-jason
Copy link

Hi @umardraz , I'm having the same problem, did you find a workaround for this ?

@gen4sp
Copy link

gen4sp commented Mar 8, 2020

same

@mguella
Copy link

mguella commented May 15, 2020

It works in Nuxt.js production mode when setting mode: 'client' in nuxt.config.js
(see #209 (comment))

e.g.

plugins: [
    { src: '~/plugins/infinite-load.js', mode: 'client', ssr: false }
]

and when wrapping infinite-loading with a <client-only> tag in the template
(see #209 (comment))

e.g.

<client-only>
  <infinite-loading @infinite="next">
    <div slot="no-more"></div>
    <div slot="no-results"></div>
  </infinite-loading>
</client-only>

@menepet
Copy link

menepet commented Jul 18, 2020

Here is an updated version instead of using ...

https://medium.com/@sabbir.study/infinite-scroll-in-nuxt-js-f34ee86906cb

@greetfish
Copy link

greetfish commented Jun 12, 2021

我是这样用的
配置文件
plugins: [ { src: '~/plugins/vue-infinite-loading.js', mode: 'client', ssr: false } ],

~/plugins/vue-infinite-loading.js
`
import Vue from 'vue'
import InfiniteLoading from 'vue-infinite-loading'

if (typeof document !== 'undefined') {
console.log('broswer环境')
Vue.component('infinite-loading', InfiniteLoading)
} else {
console.log('NodeJs环境')
}
`

使用
<client-only> <infinite-loading @infinite="infiniteHandler"></infinite-loading> </client-only>

特别注意一个深坑:vue-infinite-loading的父元素不能是flex布局的 (farther element can't be flex display)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants