main.js 1.03 KB
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

潘际乾 committed
8 9 10
import 'quill/dist/quill.core.css' // import styles
import 'quill/dist/quill.snow.css' // for snow theme

11 12 13
import App from "./App.vue";
import RootRouter from "./routers";
import store from "./store";
fukai committed
14

15
import "~/assets/css/common.css";
fukai committed
16

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

23
window.SUCCESS = "AAAAAA";
fukai committed
24

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

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

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