What does this package do?
- get all modules
- get auth user modules and set in local storage (with logout remove from storage)
- set current module and set in local storage (with logout remove from storage)
- this package is a special package for willaengine project
- [x] use package we-axios.
- [x] use package we-auth.
##install
npm install we-module
##Usage
use in main:
import Module from 'we-module'
Vue.use(Module, options);
defult Options:
const options = {
current: '',
api: {
modules: 'v1/modules',
userModule: 'v1/user-modules'
}
};
###use Module
use in component $module.all
and $module.user
use in js file Vue.prototype.$module.all
and Vue.prototype.$module.user
###set Current Module in Project
set in component $module.current
set in js File Vue.prototype.$module.current
OR
import Vue from 'vue'
import {setCurrentModule} from 'we-module'
setCurrentModule(Vue, 'moduleName');