ragnarlotus / vue-flux

Image slider which comes with 20 cool transitions
https://ragnarlotus.github.io/vue-flux-docs/demos/demos
MIT License
542 stars 49 forks source link

Not work with Nuxt 2.4.3 #44

Closed kamontat closed 5 years ago

kamontat commented 5 years ago

The website is run and freeze.

d0peCode commented 5 years ago

nuxt.config.js

  plugins: [{
    src: '~/node_modules/vue-flux', ssr: false
  }],
  build: {
    vendor : ['vue-flux'],

index.vue

let VueFlux;
let Transitions;

if (process.browser) {
   const VF = require('vue-flux');
   VueFlux = VF.VueFlux;
   Transitions = VF.Transitions;
}

export default {
   components: {
      VueFlux
   },

   data: () => ({
      fluxOptions: {
         autoplay: false
      },
      fluxImages: [
         'https://source.unsplash.com/random',
         'https://source.unsplash.com/random',
         'https://source.unsplash.com/random'
      ],
      fluxTransitions: Transitions
   })
}

Additionally wrap component in which you have vue-flux with <no-ssr> tag.

ragnarlotus commented 5 years ago

Thanks @BorysTyminski !!

I added a section in wiki for SSR with Nuxt

If everything goes well I will have the new architecture finished this weekend with the lazy loading. I would have like to finish it before but I have been pretty busy.

Regards!

CodyBontecou commented 3 years ago

Thanks @BorysTyminski !!

I added a section in wiki for SSR with Nuxt

If everything goes well I will have the new architecture finished this weekend with the lazy loading. I would have like to finish it before but I have been pretty busy.

Regards!

It looks like the wiki link no longer works.

EDIT: Found the post here → https://ragnarlotus.github.io/vue-flux-docs/v6/ssr-with-nuxt.html