main.js 993 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import App from './App'
  2. import {
  3. toast,
  4. transDictLabel,
  5. changeDictAttrName,
  6. getDictList,
  7. showConfirm
  8. } from './common/common.js'
  9. import config from '@/config.js'
  10. Vue.prototype.toast = toast
  11. Vue.prototype.transDictLabel = transDictLabel
  12. Vue.prototype.changeDictAttrName = changeDictAttrName
  13. Vue.prototype.getDictList = getDictList
  14. Vue.prototype.showConfirm = showConfirm
  15. Vue.prototype.config = config
  16. //获取cookie
  17. Vue.prototype.getCookie = function(objName){
  18. var arrStr = document.cookie.split("; ");
  19. for (var i = 0; i < arrStr.length; i++) {
  20. var temp = arrStr[i].split("=");
  21. if (temp[0] == objName){
  22. return decodeURI(temp[1]);
  23. }
  24. }
  25. }
  26. // #ifndef VUE3
  27. import Vue from 'vue'
  28. import './uni.promisify.adaptor'
  29. Vue.config.productionTip = false
  30. App.mpType = 'app'
  31. const app = new Vue({
  32. ...App
  33. })
  34. app.$mount()
  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