main.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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 App from './App'
  5. import router from './router'
  6. import ElementUI from 'element-ui';
  7. import 'element-ui/lib/theme-chalk/index.css';
  8. import './assets/icon/iconfont.css'
  9. import store from './store/index.js';
  10. import VueTypedJs from 'vue-typed-js'
  11. //富文本
  12. import VueQuillEditor from 'vue-quill-editor'
  13. import 'quill/dist/quill.core.css'
  14. import 'quill/dist/quill.snow.css'
  15. import 'quill/dist/quill.bubble.css'
  16. Vue.use(VueQuillEditor);
  17. // import CKEditor from '@ckeditor/ckeditor5-vue2'
  18. // Vue.use( CKEditor );
  19. Vue.use(VueTypedJs)
  20. import axios from 'axios';
  21. axios.defaults.baseURL = 'http://132.232.92.186:8888';
  22. //axios.defaults.baseURL = 'http://localhost:5256/';
  23. import { Message } from "element-ui";
  24. import common from './assets/js/common'//全局
  25. Vue.use(common);//全局
  26. import plugin from './plugin'//全局
  27. Vue.use(plugin);//全局
  28. import websocket from './store/websocket.js'
  29. Vue.prototype.$websocket = websocket//websocket
  30. Vue.prototype.$message = Message;
  31. Vue.prototype.$axios = axios;
  32. Vue.config.productionTip = false
  33. Vue.use(ElementUI);
  34. Vue.prototype.transformDateFormat = function (time) {
  35. var date = new Date(time);
  36. var year = date.getFullYear();
  37. /* 在日期格式中,月份是从0开始的,因此要加0
  38. * 使用三元表达式在小于10的前面加0,以达到格式统一 如 09:11:05
  39. * */
  40. var month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
  41. var day = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
  42. var hours = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
  43. var minutes = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
  44. var seconds = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
  45. // 拼接
  46. return year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds;
  47. };
  48. /* eslint-disable no-new */
  49. new Vue({
  50. el: '#app',
  51. router,
  52. store,
  53. components: { App },
  54. template: '<App/>'
  55. })