main.js 952 Bytes
Newer Older
1
import Vue from "vue";
fukai committed
2

3
import ElementUI from "element-ui";
fukai committed
4

5 6
import "element-ui/lib/theme-chalk/index.css";
import "es6-promise/auto";
fukai committed
7

8 9 10
import App from "./App.vue";
import RootRouter from "./routers";
import store from "./store";
fukai committed
11

12
import "~/assets/css/common.css";
fukai committed
13

14 15
import i18n from "./lang";
import CustomComponent from "./components";
wangren committed
16
import vuefunc from "./utils/vuefunc";
17
import "./permission";
fukai committed
18
import EventService,{LOGIN,LOGOUT} from "~/service/EventService";
潘际乾 committed
19

20
window.SUCCESS = "AAAAAA";
fukai committed
21

22 23
Vue.use(ElementUI, { size: "small", i18n: (key, value) => i18n.t(key, value) });
Vue.use(CustomComponent);
wangren committed
24
Vue.use(vuefunc);
fukai committed
25

fukai committed
26 27 28 29 30 31 32 33 34 35 36 37 38 39
function resetCache(){
  window.GLOBAL_CACHE = {PAGEID_CACHE:new Set()};
}
//初始化cache
resetCache();
//登录后重置
EventService.on(LOGIN,()=>{
  resetCache();
});
//退出后重置
EventService.on(LOGOUT,()=>{
  resetCache();
});

fukai committed
40
new Vue({
41
  el: "#app",
fukai committed
42
  store,
43 44 45 46
  i18n,
  router: RootRouter,
  render: (h) => h(App),
});