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
With Nuxt.js #75
Comments
Component does not support the SSR, because the component used |
Hi @NightCatSama, I managed to get it working for client-side only. With the help of this tutorial https://alligator.io/vuejs/hide-no-ssr/ to keep client and server DOM equal and Nuxt.js proposal for window undefined https://nuxtjs.org/faq/window-document-undefined. Seems prety good in 'dev' mode, I have not prove it on production yet. Cheers! |
It's great, welcome to give your pr to modify the README file. |
@epartipilo You can share your Hack ? |
@NightCatSama I already have the Readme.md updated in a new branch but I don't have the permission to make the push and pr. Cheers! |
@epartipilo You have to fork the project down and then submit pr to me. |
@epartipilo Did you register the component correctly? Like this: ~plugins/vue-slider-component.js import Vue from 'vue'
import VueSlider from 'vue-slider-component'
Vue.component('vue-slider', VueSlider) nuxt.config.js plugins: [
//...
{
src: '~plugins/vue-slider-component.js',
ssr: false
}
] test.vue <template>
<vue-slider ref="slider" v-model="price"></vue-slider>
</template> |
Hello @maicong
in the .vue file where I used it |
Hello @maicong , I just updated the README file to explain the hack for using it with Nuxt. Cheers |
@maicong I tried your solution but did not work for me. Still getting:
|
Hello, everyone! And thanks @epartipilo for the solution :) |
This solution works for me! Thanks a lot :) |
don't forget also to add the CSS in one of these ways:
|
I registered plugin as described but I still had to wrap it with in order to get it rendered and avoid error related to mismatch of client and server rendered DOM. Hope it might be helpful |
Has anyone tried using this with Nuxt 3? |
Have you figure out a way to import it in nuxt 3 |
Hi,
Is there any way to this awesome component with Nuxt.js?
Right now I have this on
plugins/
directory,this
{src: '~plugins/vue-slider-component', ssr: false}
on nuxt.config.js,and this
<vue-slider ref="slider" v-model="price"></vue-slider>
on my template but it's not rendering the component.The only way I get to render it is importing the component on the template, it show the component the first time and works but when reloading the page it gives me de server window not defined error.
Thanks!
The text was updated successfully, but these errors were encountered: