main.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. //引入mescroll插件
  10. import MescrollBody from "@/components/mescroll-uni/mescroll-body.vue"
  11. import MescrollUni from "@/components/mescroll-uni/mescroll-uni.vue"
  12. Vue.component('mescroll-body', MescrollBody);
  13. Vue.component('mescroll-uni', MescrollUni);
  14. // 注册缓存器
  15. Vue.use(MinCache,{timeout: 6})
  16. // store
  17. Vue.prototype.$store=store;
  18. // tip
  19. Vue.prototype.$tip=tip;
  20. // config
  21. Vue.prototype.$config=configService;
  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 people from './pages/user/people.vue'
  28. Vue.component('people',people)
  29. // 自定义组件
  30. import mySelect from './components/my-componets/my-select.vue'
  31. Vue.component('mySelect',mySelect)
  32. import myImageUpload from './components/my-componets/my-image-upload.vue'
  33. Vue.component('myImageUpload',myImageUpload)
  34. import myPage from './components/my-componets/my-page.vue'
  35. Vue.component('myPage',myPage)
  36. import basics from './pages/basics/home.vue'
  37. Vue.component('basics',basics)
  38. import components from './pages/component/home.vue'
  39. Vue.component('components',components)
  40. import plugin from './pages/plugin/home.vue'
  41. Vue.component('plugin',plugin)
  42. import cuCustom from './plugin/colorui/components/cu-custom.vue'
  43. Vue.component('cu-custom',cuCustom)
  44. // import VConsole from './js_sdk/vconsole.min'
  45. // var vConsole = new VConsole();
  46. Vue.config.productionTip = false
  47. App.mpType = 'app'
  48. const app = new Vue({
  49. store,
  50. MinCache,
  51. ...App
  52. })
  53. //v1.3.5起 H5端 你应该去除原有的app.$mount();使用路由自带的渲染方式
  54. // #ifdef H5
  55. RouterMount(app,'#app');
  56. // #endif
  57. // #ifndef H5
  58. app.$mount(); //为了兼容小程序及app端必须这样写才有效果
  59. // #endif