main.js 2.3 KB

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