审查视图

shenhailong authored
1
朱兆平 authored
2 3 4
import Vue from 'vue'
import App from './App'
import ElementUI from 'element-ui'
5
import 'element-ui/lib/theme-chalk/index.css'
朱兆平 authored
6 7 8 9
//import './assets/theme/theme-green/index.css'
import VueRouter from 'vue-router'
import store from './vuex/store'
import Vuex from 'vuex'
10
import axios from 'axios'
11
import rout from './routes'
朱兆平 authored
12
import Mock from './mock'
朱兆平 authored
13
import i18n from './lang'
14
import 'font-awesome/css/font-awesome.min.css'
15
16
import * as socketApi from './api/socket'
17
import '@/styles/index.scss'
朱兆平 authored
18
import sys_init from '@/common/init/sys_init'
19
20
21 22 23 24 25
//定义一个全局过滤器实现日期格式化
Vue.filter('datefmt',function(input,fmtstring){

    return moment(input).format(fmtstring)
26 27
});
28 29
// 注册websocket组件到VUE
Vue.prototype.socketApi = socketApi
30
31
Vue.config.productionTip = false
朱兆平 authored
32 33 34 35
Mock.bootstrap();
Vue.use(ElementUI)
Vue.use(VueRouter)
Vue.use(Vuex)
36
Vue.prototype.$axios = axios;
朱兆平 authored
37 38

//NProgress.configure({ showSpinner: false });
zhangFan authored
39 40
// console.log("mainjs:");
// console.log(rout.routes);
朱兆平 authored
41
const router = new VueRouter({
42
    routes:rout.routes
43
});
44
Vue.prototype.$rout =router;
45 46 47 48

//本地存储系统初始化的router路由,用来处理用户退出后,把路由数据初始化
sessionStorage.setItem('sysMenu', JSON.stringify(rout.routes));
zhangFan authored
49
const message = Vue.prototype.$message;
朱兆平 authored
50 51
sys_init.init_axios(message,router,axios);
sys_init.init_router(router,axios);
朱兆平 authored
52 53 54 55 56

//router.afterEach(transition => {
//NProgress.done();
//});
57
let vue = new Vue({
朱兆平 authored
58 59 60 61
  //el: '#app',
  //template: '<App/>',
  router,
  store,
朱兆平 authored
62
  i18n,
朱兆平 authored
63 64 65 66
  //components: { App }
  render: h => h(App)
}).$mount('#app')