main.js 746 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import Vue from 'vue'
  2. import App from './App'
  3. import store from './store'
  4. import uView from 'uview-ui'
  5. import bootstrap from './core/bootstrap'
  6. import {
  7. getPlatform,
  8. navTo,
  9. showToast,
  10. showSuccess,
  11. showError,
  12. getShareUrlParams
  13. } from './utils/app'
  14. import './core/ican-H5Api'
  15. Vue.config.productionTip = false
  16. App.mpType = 'app'
  17. // 当前运行的终端
  18. Vue.prototype.$platform = getPlatform()
  19. // 载入uView库
  20. Vue.use(uView)
  21. // 挂载全局函数
  22. Vue.prototype.$toast = showToast
  23. Vue.prototype.$success = showSuccess
  24. Vue.prototype.$error = showError
  25. Vue.prototype.$navTo = navTo
  26. Vue.prototype.$getShareUrlParams = getShareUrlParams
  27. // 实例化应用
  28. const app = new Vue({
  29. ...App,
  30. store,
  31. created: bootstrap
  32. })
  33. app.$mount()