Skip to content

Latest commit

 

History

History
52 lines (45 loc) · 1010 Bytes

GUIDE_SSR.md

File metadata and controls

52 lines (45 loc) · 1010 Bytes

Global Registration

SSR

if (process.browser) {
  const VueFlicking = require("@egjs/vue-flicking");
  Vue.use(VueFlicking);
}

Nuxt Nuxt.js

// Suppose this file is /plugins/install
import Vue from "vue";
import VueFlicking from "@egjs/vue-flicking";

Vue.use(VueFlicking);

Then, in nuxt.config.js

// ❗ CAUTION: No "ssr: false" or "mode: 'client'" is needed
plugins: ['~/plugins/install'],
build: {
  loaders: {
    vue: {
      compilerOptions: {
        // This option is highly recommended
        preserveWhitespace: false
      }
    }
  }
},

📖 More Examples for Nuxt Nuxt.js

See our code sandbox examples.

Local development

Project setup

npm install

Compiles and hot-reloads demo

npm run dev

Lints and fixes files

npm run lint