main.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // The Vue build version to load with the `import` command
  2. // (runtime-only or standalone) has been set in webpack.base.conf with an alias.
  3. import Vue from 'vue'
  4. import ElementUI from 'element-ui'
  5. import 'element-ui/lib/theme-chalk/index.css'
  6. import App from './App'
  7. import store from './store'
  8. import router from './router'
  9. Vue.config.productionTip = false
  10. // 引入第三方包
  11. import wsk from './utils/web-socket' // 引入 websocket
  12. import dayjs from 'dayjs'
  13. // import axios from 'axios'
  14. import qs from 'qs'
  15. import * as echarts from 'echarts'
  16. import { SVGRenderer, CanvasRenderer } from 'echarts/renderers'
  17. import _ from 'lodash'
  18. // 挂载第三方包
  19. echarts.use([SVGRenderer, CanvasRenderer])
  20. Vue.prototype.$wsk = wsk // 将 websocket 挂载到 Vue 全局上,方便每个页面使用
  21. Vue.prototype.$dayjs = dayjs
  22. Vue.prototype._ = _
  23. Vue.prototype.$qs = qs
  24. // Vue.prototype.$axios = axios
  25. Vue.prototype.$echarts = echarts
  26. Vue.use(ElementUI)
  27. // 引入自定义指令
  28. import './utils/debounce' // 按钮防抖
  29. /* eslint-disable no-new */
  30. new Vue({
  31. el: '#app',
  32. store,
  33. router,
  34. components: { App },
  35. template: '<App/>',
  36. })