blob: b5fa135dec2e8e0f59342d7c330ab63eae42212c [file] [log] [blame]
sijun.li96462302020-07-24 10:08:05 +08001import Vue from 'vue'
2
3import Cookies from 'js-cookie'
4
5import 'normalize.css/normalize.css' // a modern alternative to CSS resets
6
7import Element from 'element-ui'
8import './styles/element-variables.scss'
9import enLang from 'element-ui/lib/locale/lang/en'// 如果使用中文语言包请默认支持,无需额外引入,请删除该依赖
10
11import '@/styles/index.scss' // global css
12
13import App from './App'
14import store from './store'
15import router from './router'
16
17import './icons' // icon
18import './permission' // permission control
19import './utils/error-log' // error log
20
21import * as filters from './filters' // global filters
22
23/**
24 * If you don't want to use mock-server
25 * you want to use MockJs for mock api
26 * you can execute: mockXHR()
27 *
28 * Currently MockJs will be used in the production environment,
29 * please remove it before going online ! ! !
30 */
31if (process.env.NODE_ENV === 'production') {
32 const { mockXHR } = require('../mock')
33 mockXHR()
34}
35
36Vue.use(Element, {
37 size: Cookies.get('size') || 'medium', // set element-ui default size
38 locale: enLang // 如果使用中文,无需设置,请删除
39})
40
41// register global utility filters
42Object.keys(filters).forEach(key => {
43 Vue.filter(key, filters[key])
44})
45
46Vue.config.productionTip = false
47
48new Vue({
49 el: '#app',
50 router,
51 store,
52 render: h => h(App)
53})