main.js 899 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import ElementPlus from 'element-plus' //添加
  2. import 'element-plus/dist/index.css' //添加
  3. // import locale from 'element-plus/lib/locale/lang/zh-cn' //切换为中文版本
  4. import App from './App'
  5. import appPush from '@/js_sdk/levine-APPPush/levine-APPPush/plugins/APPPush/index.js'
  6. import Print from 'vue3-print-nb'
  7. // #ifndef VUE3
  8. import Vue from 'vue'
  9. import './uni.promisify.adaptor'
  10. Vue.config.productionTip = false
  11. App.mpType = 'app'
  12. const app = new Vue({
  13. ...App
  14. })
  15. app.$mount()
  16. // #endif
  17. // 封装弹框的方法
  18. uni.$showMsg = (title = '数据请求失败!', duration = 1500) => {
  19. uni.showToast({
  20. title,
  21. duration,
  22. icon: 'none'
  23. })
  24. }
  25. uni.$appPush = appPush
  26. // #ifdef VUE3
  27. import { createSSRApp } from 'vue'
  28. export function createApp() {
  29. const app = createSSRApp(App)
  30. app.use(Print)
  31. app.use(ElementPlus)
  32. // app.use(appPush)
  33. return {
  34. app
  35. }
  36. }
  37. // #endif