main.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. /* 引入aos动画库相关文件 */
  51. import AOS from 'aos'
  52. import 'aos/dist/aos.css'
  53. /* aos动画初始化 */
  54. AOS.init({
  55. duration: 300,
  56. easing:"linear"
  57. });
  58. // #endif
  59. // #ifdef VUE3
  60. import { createSSRApp } from 'vue'
  61. export function createApp() {
  62. const app = createSSRApp(App)
  63. return {
  64. app
  65. }
  66. }
  67. // #endif