审查视图

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'
朱兆平 authored
19
import jsutil from "@/common/js/util";
20
21
22 23 24 25 26
//定义一个全局过滤器实现日期格式化
Vue.filter('datefmt',function(input,fmtstring){

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

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

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

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