main.js 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. import Vue from "vue";
  2. import App from "./App";
  3. import store from "./store";
  4. import MinCache from "./common/util/MinCache.js";
  5. import tip from "./common/util/tip.js";
  6. import configService from "./common/service/config.service.js";
  7. import router from "./common/router";
  8. import { RouterMount } from "./plugin/uni-simple-router/index.js";
  9. import * as echarts from 'echarts'
  10. Vue.prototype.$echarts = echarts
  11. // 注册缓存器
  12. Vue.use(MinCache, { timeout: 6 });
  13. // store
  14. Vue.prototype.$store = store;
  15. // tip
  16. Vue.prototype.$tip = tip;
  17. // config
  18. Vue.prototype.$config = configService;
  19. import uView from "@/uni_modules/uview-ui";
  20. Vue.use(uView);
  21. // request请求
  22. import { http } from "@/common/service/service.js";
  23. Vue.prototype.$http = http;
  24. import home from "./pages/home/home.vue";
  25. Vue.component("home", home);
  26. import operation from "./pages/operation/operation.vue";
  27. Vue.component("operation", operation);
  28. import camera from "./pages/camera/camera.vue";
  29. Vue.component("camera", camera);
  30. import history from "./pages/history/history.vue";
  31. Vue.component("history", history);
  32. import warndata from "./pages/warndata/warndata.vue";
  33. Vue.component("warndata", warndata);
  34. import filecenter from "./pages/filecenter/filecenter.vue";
  35. Vue.component("filecenter", filecenter);
  36. import gasreport from "./pages/gasreport/gasreport.vue";
  37. Vue.component("gasreport", gasreport);
  38. // 自定义组件
  39. import mySelect from "./components/my-componets/my-select.vue";
  40. Vue.component("mySelect", mySelect);
  41. import myImageUpload from "./components/my-componets/my-image-upload.vue";
  42. Vue.component("myImageUpload", myImageUpload);
  43. import myPage from "./components/my-componets/my-page.vue";
  44. Vue.component("myPage", myPage);
  45. import basics from "./pages/basics/home.vue";
  46. Vue.component("basics", basics);
  47. import components from "./pages/component/home.vue";
  48. Vue.component("components", components);
  49. import plugin from "./pages/plugin/home.vue";
  50. Vue.component("plugin", plugin);
  51. import cuCustom from "./plugin/colorui/components/cu-custom.vue";
  52. Vue.component("cu-custom", cuCustom);
  53. // import VConsole from './js_sdk/vconsole.min'
  54. // var vConsole = new VConsole();
  55. Vue.config.productionTip = false;
  56. App.mpType = "app";
  57. const app = new Vue({
  58. store,
  59. MinCache,
  60. ...App,
  61. });
  62. //v1.3.5起 H5端 你应该去除原有的app.$mount();使用路由自带的渲染方式
  63. // #ifdef H5
  64. RouterMount(app, "#app");
  65. // #endif
  66. // #ifndef H5
  67. app.$mount(); //为了兼容小程序及app端必须这样写才有效果
  68. // #endif