main.js 852 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import App from './App'
  2. import uviewPlus, {
  3. setConfig
  4. } from "@/uni_modules/uview-plus";
  5. // #ifndef VUE3
  6. import Vue from 'vue'
  7. import './uni.promisify.adaptor'
  8. Vue.config.productionTip = false
  9. App.mpType = 'app'
  10. const app = new Vue({
  11. ...App
  12. })
  13. app.config.compilerOptions.isCustomElement = tag =>
  14. tag.startsWith('wx-open-launch-app')
  15. app.$mount()
  16. // #endif
  17. // #ifdef VUE3
  18. import {
  19. createSSRApp
  20. } from 'vue'
  21. export function createApp() {
  22. const app = createSSRApp(App)
  23. app.use(uviewPlus, () => {
  24. return {
  25. options: {
  26. // 修改$u.config对象的属性
  27. config: {
  28. // 修改默认单位为rpx,相当于执行 uni.$u.config.unit = 'rpx'
  29. unit: "rpx",
  30. // customIcon: {
  31. // family: 'iconfont',
  32. // url: '//at.alicdn.com/t/c/font_4946742_e8oa3t01rkk.css'
  33. // }
  34. },
  35. },
  36. };
  37. });
  38. return {
  39. app
  40. }
  41. }
  42. // #endif