Holla, first of all thanks to those who are answering to this question. this question might be silly to ask. i am switching my spa from vue.js to nuxt provided by vue.js but write now i am in trobule beacuse of 0% visiblity between how whole nuxt works.
Question:
- how to register global component.
- how to switch layouts in nuxt on certain user of client-side behaviour.
- where to write vue.use(someplugin).
- how to write middle ware export of method which connects to server with user ip deatils than load page.
- how to deal with enviornment variables in vue.js
- how to transfer data from any middle ware and plugin to components which i am using.
- is there any way to seperate vue component and there respective methods and data.
CURRENT PROBLEM DUE TO WHICH I HAVE NO WAY TO PROCEED ON MY PROJECT
Registering modules using vue.use(plugins) in ~plugins/registerPlugin.js ex:
'use strict';
/*
MODULE IMPORTS
*/
// npm modules.
import Vue from 'vue';
// temp modules. ex modules for registration.
import __vueCookie from 'vue-cookies'; // npm: provide cookie set and get.
import __veeValidate from 'vee-validate'; // npm: provide field validation.
import __moment from "vue-moment"; // npm: filter plugin for vue.js.
import __vueLocalStorage from 'vue-localstorage'; // npm: provide local storage api.
import __vueSessionStorage from 'vue-session'; // npm: module for managing session storage.
import __vueResource from 'vue-resource'; // npm: vue resource library.
/*
PLUGIN REGISTRATION
*/
// use vue resource library.
Vue.use(__vueResource);
// vue validate for input validation.
Vue.use(__veeValidate);
// vue filter plugin for date and time.
Vue.use(__moment);
// cookie plugin manager for vue.
Vue.use(__vueCookie);
// local storeAge manager for vue.
Vue.use(__vueLocalStorage);
// session storage manager for vue.
Vue.use(__vueSessionStorage);