main.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. import App from './App'
  2. // #ifndef VUE3
  3. import Vue from 'vue'
  4. import './uni.promisify.adaptor'
  5. Vue.config.productionTip = false
  6. App.mpType = 'app'
  7. const app = new Vue({
  8. ...App
  9. })
  10. app.$mount()
  11. import uView from 'uview-ui';
  12. Vue.use(uView);
  13. uni.$u.config.unit = 'rpx';
  14. //简化提示
  15. Vue.prototype.$showToast = function(title, duration = 2000, icon = "none") {
  16. return uni.showToast({ title, duration, icon });
  17. }
  18. //挂载api
  19. import apis from '@/apis/index.js';
  20. Vue.prototype.$api = apis;
  21. //日期格式处理
  22. import dateFormat from '@/utils/dateFormat.js';
  23. Vue.use(dateFormat);
  24. //引入校验库
  25. import reg from '@/utils/htc.js'
  26. Vue.prototype.$reg = reg;
  27. //全局属性
  28. import pageCommon from '@/mixins/common.js'
  29. Vue.mixin(pageCommon);
  30. //全局注册组件
  31. import uHeader from '@/components/common/uHeader'
  32. Vue.component('uHeader',uHeader);
  33. import cusEcharts from '@/components/cusEcharts/index'
  34. Vue.component('cusEcharts',cusEcharts);
  35. //tabbar
  36. import tabbar from '@/components/Tabbar/tabbar'
  37. Vue.component('tabbar',tabbar);
  38. //uTop(logo+menu)
  39. import uTop from '@/components/common/uTop'
  40. Vue.component('uTop',uTop);
  41. //uDesc
  42. import uDesc from '@/components/common/uDesc'
  43. Vue.component('uDesc',uDesc);
  44. //uFunction
  45. import uFunction from '@/components/common/uFunction'
  46. Vue.component('uFunction',uFunction);
  47. //uForm
  48. import uForm from '@/components/common/uForm'
  49. Vue.component('uForm',uForm);
  50. // #endif
  51. // #ifdef VUE3
  52. import { createSSRApp } from 'vue'
  53. export function createApp() {
  54. const app = createSSRApp(App)
  55. return {
  56. app
  57. }
  58. }
  59. // #endif