main.js 2.4 KB

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