main.js 980 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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 =async (urlName) => {
  10. console.log('getCosPath:路径转换调用')
  11. console.log(urlName)
  12. let url=await cosServe.getSignUrl(urlName);
  13. console.log(url)
  14. return url;
  15. };
  16. Vue.use(router)
  17. // #ifndef VUE3
  18. import Vue from 'vue'
  19. import store from './store'
  20. import Nav from './components/en-utils/en-nav/en-nav.vue'
  21. Vue.component('Nav', Nav);
  22. Vue.config.productionTip = false
  23. App.mpType = 'app'
  24. const app = new Vue({
  25. ...App,
  26. store
  27. })
  28. // app.$mount()
  29. // #ifdef H5
  30. RouterMount(app, router, '#app')
  31. // #endif
  32. // #ifndef H5
  33. app.$mount(); //为了兼容小程序及app端必须这样写才有效果
  34. // #endif
  35. // #endif
  36. // #ifdef VUE3
  37. import {
  38. createSSRApp
  39. } from 'vue'
  40. export function createApp() {
  41. const app = createSSRApp(App)
  42. return {
  43. app,
  44. }
  45. }
  46. // #endif