main.js 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. // import '@/common/pc.js'
  2. import Vue from 'vue'
  3. import App from './App'
  4. import store from './store'
  5. import MinCache from './common/util/MinCache.js'
  6. import tip from './common/util/tip.js'
  7. import configService from './common/service/config.service.js'
  8. import router from './common/router'
  9. import {
  10. RouterMount
  11. } from './plugin/uni-simple-router/index.js'
  12. import {
  13. mdSig
  14. } from '@/common/util/md.js'
  15. import VueSignaturePad from "vue-signature-pad";
  16. // request请求
  17. import {
  18. http
  19. } from '@/common/service/service.js'
  20. import home from './pages/home/home.vue'
  21. import people from './pages/user/people.vue'
  22. import mySelect from './components/my-componets/my-select.vue'
  23. import myImageUpload from './components/my-componets/my-image-upload.vue'
  24. import myPage from './components/my-componets/my-page.vue'
  25. import basics from './pages/basics/home.vue'
  26. import cuCustom from './plugin/colorui/components/cu-custom.vue'
  27. import autograph from '@/components/autograph/autograph.vue'
  28. import search from '@/components/search/nx-search.vue'
  29. import linPopup from '@/components/lin-popup/index.vue'
  30. import dayjs from "dayjs" //封装dayjs
  31. import showToast from "@/common/util/showToast.js"
  32. import methCommon from "@/common/util/meth.js"
  33. import uploades from "@/common/util/upload.js"
  34. //ui框架
  35. import uView from "uview-ui";
  36. Vue.use(uView);
  37. Vue.use(VueSignaturePad);
  38. // 注册缓存器
  39. Vue.use(MinCache, {
  40. timeout: 6
  41. })
  42. Vue.prototype.$store = store
  43. Vue.prototype.$tip = tip
  44. Vue.prototype.$config = configService
  45. Vue.prototype.$sig = mdSig
  46. Vue.prototype.$http = http
  47. Vue.prototype.$dayjs = dayjs
  48. Vue.prototype.$showToast = showToast
  49. Vue.prototype.$methCommon = methCommon
  50. Vue.prototype.$uploades = uploades
  51. Vue.component('home', home)
  52. Vue.component('people', people)
  53. Vue.component('mySelect', mySelect)
  54. Vue.component('myImageUpload', myImageUpload)
  55. Vue.component('myPage', myPage)
  56. Vue.component('basics', basics)
  57. Vue.component('cu-custom', cuCustom)
  58. Vue.component('autograph', autograph)
  59. Vue.component('search', search)
  60. Vue.component('linPopup', linPopup)
  61. Vue.config.productionTip = false
  62. App.mpType = 'app'
  63. const app = new Vue({
  64. store,
  65. MinCache,
  66. ...App
  67. })
  68. //v1.3.5起 H5端 你应该去除原有的app.$mount();使用路由自带的渲染方式
  69. // #ifdef H5
  70. RouterMount(app, '#app');
  71. // #endif
  72. // #ifndef H5
  73. app.$mount(); //为了兼容小程序及app端必须这样写才有效果
  74. // #endif