if (process.browser) {
const VueFlicking = require("@egjs/vue-flicking");
Vue.use(VueFlicking);
}
// 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
}
}
}
},
See our code sandbox examples.
npm install
npm run dev
npm run lint