main.js 1.8 KB

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