main.js 914 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import '.env.js'
  2. import App from './App'
  3. //引入前置路由颜值
  4. import {
  5. router,
  6. RouterMount
  7. } from './service/router.js' //路径换成自己的
  8. import cosServe from "@/service/txOssSts";
  9. Vue.prototype.getCosPath = (urlName) => {
  10. console.log('getCosPath:路径转换调用')
  11. return cosServe.getSignUrl(urlName);
  12. };
  13. Vue.use(router)
  14. // #ifndef VUE3
  15. import Vue from 'vue'
  16. import store from './store'
  17. import Nav from './components/en-utils/en-nav/en-nav.vue'
  18. Vue.component('Nav', Nav);
  19. Vue.config.productionTip = false
  20. App.mpType = 'app'
  21. const app = new Vue({
  22. ...App,
  23. store
  24. })
  25. // app.$mount()
  26. // #ifdef H5
  27. RouterMount(app, router, '#app')
  28. // #endif
  29. // #ifndef H5
  30. app.$mount(); //为了兼容小程序及app端必须这样写才有效果
  31. // #endif
  32. // #endif
  33. // #ifdef VUE3
  34. import {
  35. createSSRApp
  36. } from 'vue'
  37. export function createApp() {
  38. const app = createSSRApp(App)
  39. return {
  40. app,
  41. }
  42. }
  43. // #endif