2017-08-21 07:55:46 +00:00
|
|
|
import Vue from 'vue'
|
2017-12-15 06:07:55 +00:00
|
|
|
|
2018-08-29 07:24:47 +00:00
|
|
|
import Cookies from 'js-cookie'
|
|
|
|
|
2019-04-16 03:20:13 +00:00
|
|
|
import 'normalize.css/normalize.css' // a modern alternative to CSS resets
|
2017-12-15 06:07:55 +00:00
|
|
|
|
2017-11-01 02:03:28 +00:00
|
|
|
import Element from 'element-ui'
|
2019-04-01 09:07:16 +00:00
|
|
|
import './styles/element-variables.scss'
|
2017-12-15 06:07:55 +00:00
|
|
|
|
|
|
|
import '@/styles/index.scss' // global css
|
|
|
|
|
2017-08-21 07:55:46 +00:00
|
|
|
import App from './App'
|
|
|
|
import store from './store'
|
2019-01-29 08:54:38 +00:00
|
|
|
import router from './router'
|
2017-12-15 06:07:55 +00:00
|
|
|
|
2019-04-16 03:20:13 +00:00
|
|
|
import i18n from './lang' // internationalization
|
2017-08-30 10:22:32 +00:00
|
|
|
import './icons' // icon
|
2017-12-15 06:07:55 +00:00
|
|
|
import './permission' // permission control
|
2019-04-12 09:13:27 +00:00
|
|
|
import './utils/error-log' // error log
|
2017-12-15 06:07:55 +00:00
|
|
|
|
2017-12-29 08:07:42 +00:00
|
|
|
import * as filters from './filters' // global filters
|
2017-04-18 07:09:13 +00:00
|
|
|
|
2018-10-08 10:26:39 +00:00
|
|
|
import VueAnalytics from 'vue-analytics'
|
|
|
|
|
|
|
|
Vue.use(VueAnalytics, {
|
|
|
|
id: 'UA-109340118-1',
|
|
|
|
router
|
|
|
|
})
|
|
|
|
|
2019-04-16 03:20:13 +00:00
|
|
|
/**
|
|
|
|
* If you don't want to use mock-server
|
2019-05-10 06:47:57 +00:00
|
|
|
* you want to use MockJs for mock api
|
|
|
|
* you can execute: mockXHR()
|
2019-04-16 03:20:13 +00:00
|
|
|
*
|
2019-05-10 06:47:57 +00:00
|
|
|
* Currently MockJs will be used in the production environment,
|
|
|
|
* please remove it before going online! ! !
|
2019-04-16 03:20:13 +00:00
|
|
|
*/
|
2019-05-10 06:47:57 +00:00
|
|
|
import { mockXHR } from '../mock'
|
|
|
|
if (process.env.NODE_ENV === 'production') {
|
|
|
|
mockXHR()
|
|
|
|
}
|
2019-04-01 09:07:16 +00:00
|
|
|
|
2017-11-03 10:37:49 +00:00
|
|
|
Vue.use(Element, {
|
2018-08-29 07:24:47 +00:00
|
|
|
size: Cookies.get('size') || 'medium', // set element-ui default size
|
2017-11-03 10:37:49 +00:00
|
|
|
i18n: (key, value) => i18n.t(key, value)
|
|
|
|
})
|
2017-04-18 07:09:13 +00:00
|
|
|
|
2019-04-16 03:20:13 +00:00
|
|
|
// register global utility filters
|
2017-04-18 07:09:13 +00:00
|
|
|
Object.keys(filters).forEach(key => {
|
|
|
|
Vue.filter(key, filters[key])
|
2017-08-21 07:55:46 +00:00
|
|
|
})
|
2017-07-06 09:56:17 +00:00
|
|
|
|
2017-08-21 07:55:46 +00:00
|
|
|
Vue.config.productionTip = false
|
2017-04-18 07:09:13 +00:00
|
|
|
|
|
|
|
new Vue({
|
2017-06-26 03:21:53 +00:00
|
|
|
el: '#app',
|
2017-04-18 07:09:13 +00:00
|
|
|
router,
|
|
|
|
store,
|
2017-11-03 10:37:49 +00:00
|
|
|
i18n,
|
2018-06-25 03:17:47 +00:00
|
|
|
render: h => h(App)
|
2017-06-26 03:21:53 +00:00
|
|
|
})
|