main.js 767 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import Vue from 'vue'
  2. import App from './App.vue'
  3. import store from './lib/store'
  4. import '@/lazy'
  5. import '@/assets/css/dark.less'
  6. import '@/assets/css/style.less'
  7. import {router, routes} from './router'
  8. import NProgress from 'nprogress'
  9. import 'nprogress/nprogress.css'
  10. import utils from '@/lib/utils'
  11. import api from '@/api'
  12. Vue.use(utils)
  13. Vue.config.productionTip = false
  14. Vue.prototype.$routeConfig = routes
  15. Vue.prototype.$api = api
  16. NProgress.configure({
  17. easing: 'ease',
  18. speed: 500,
  19. showSpinner: false,
  20. trickleSpeed: 200,
  21. minimum: 0.3
  22. })
  23. router.beforeEach((to, from, next) => {
  24. NProgress.start()
  25. next()
  26. })
  27. router.afterEach(() => {
  28. NProgress.done()
  29. })
  30. new Vue({
  31. store,
  32. router,
  33. render: h => h(App)
  34. }).$mount('#app')