fuliqi
2024-06-06 711555c3d5c36a0b2ca34eb9dc8b31a8101d9e81
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import Vue from 'vue'
import App from './App.vue'
import { router } from './router'
import store from './store'
import 'normalize.css/normalize.css'
import Element from 'element-ui'
import './styles/element-variables.scss'
 
import '@/styles/index.scss' // global css
import './icons' // icon
import NProgress from 'nprogress' // progress bar
import 'nprogress/nprogress.css' // progress bar style
import './design/index.scss'
 
Vue.use(Element, {
  size: 'medium' // set element-ui default size
})
 
Vue.config.productionTip = false
 
NProgress.configure({ showSpinner: false }) // NProgress Configuration
 
router.beforeEach(async (to, from, next) => {
  // start progress bar
  NProgress.start()
  if (to.meta.title !== undefined) {
    document.title = to.meta.title
  } else {
    document.title = '\u200E'
  }
  store.commit('router/initRoutes')
 
  if (to.path) {
    // eslint-disable-next-line no-undef
    _hmt.push(['_trackPageview', '/#' + to.fullPath])
  }
 
  next()
})
 
router.afterEach(() => {
  // finish progress bar
  NProgress.done()
})
 
Vue.prototype.$$router = router
 
new Vue({
  router: router,
  store: store,
  render: h => h(App)
}).$mount('#app')