Open PhouvanhKCSV opened 5 years ago
Hi, @PhouvanhKCSV, Sorry, no SSR support for the time being, We will support it in the near future, ths
Thanks
For use in Nuxt.js you need to do:
create file vue-concise-slider.js in plugins directory
import Vue from 'vue';
import { slider, slideritem } from 'vue-concise-slider';
Vue.component('Slider', slider);
Vue.component('SliderItem', slideritem);
update nuxt.config.js
plugins: [
...
{ src: '~/plugins/vue-concise-slider', ssr: false },
],
and use global components Slider and SliderItem
<template>
<div style="width:100%;margin:20px auto;height:400px">
<slider ref="slider" :options="options" @init='onInit' @slide="slide">
<slider-item
v-for="(item,index) in pages"
:key="index"
:style="item.style"
>
{{item.html}}
</slider-item>
</slider>
</div>
</template>
it worked for me
@karambafe thanks
its alse new about window is not defined ?
For use in Nuxt.js you need to do:
create file vue-concise-slider.js in plugins directory
import Vue from 'vue'; import { slider, slideritem } from 'vue-concise-slider'; Vue.component('Slider', slider); Vue.component('SliderItem', slideritem);
update nuxt.config.js
plugins: [ ... { src: '~/plugins/vue-concise-slider', ssr: false }, ],
and use global components Slider and SliderItem
<template> <div style="width:100%;margin:20px auto;height:400px"> <slider ref="slider" :options="options" @init='onInit' @slide="slide"> <slider-item v-for="(item,index) in pages" :key="index" :style="item.style" > {{item.html}} </slider-item> </slider> </div> </template>
it worked for me
I have "vue": "^2.6.14", and "vue-concise-slider": "^4.2.5" nad doesnt work for me.
I've tried this
in nuxt plugin files and use this in nuxt.config.js
But it is still not work, could someone please suggest. Thanks