main.js 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. import Vue from 'vue'
  2. import 'animate.css'
  3. import {
  4. Cell,
  5. CellGroup,
  6. Icon,
  7. Notify,
  8. Form,
  9. Tabbar,
  10. TabbarItem,
  11. Button,
  12. Field,
  13. Toast,
  14. Card,
  15. NavBar,
  16. Image, SwipeItem, Tag, Swipe, Divider, Picker, Popup, Dialog, List, ImagePreview
  17. } from 'vant';
  18. import App from './App.vue'
  19. import { Login, redirect, getQueryPath } from './util/initial'
  20. // import Questionnaire from './views/components/Questionnaire'
  21. // import Loading from './views/components/Questionnaire/Loading.vue';
  22. import router from './router/index'//路由
  23. import store from './store';//状态管理
  24. import './global_style.less'
  25. // 如果有 query 分享路径
  26. const queryPath = getQueryPath()
  27. if (queryPath) {
  28. window.location.href = queryPath
  29. }
  30. Vue.config.productionTip = false
  31. Vue.use(Popup);
  32. // Vue.use(parseTime);
  33. Vue.use(Picker);
  34. Vue.use(List);
  35. Vue.use(Dialog);
  36. Vue.use(Divider);
  37. Vue.use(Swipe);
  38. Vue.use(Tag);
  39. Vue.use(ImagePreview);
  40. Vue.use(NavBar);
  41. Vue.use(SwipeItem);
  42. Vue.use(Image);
  43. Vue.use(Toast);
  44. Vue.use(Card);
  45. Vue.use(Form);
  46. Vue.use(Field);
  47. Vue.use(Cell);
  48. Vue.use(CellGroup);
  49. Vue.use(Notify);
  50. Vue.use(Tabbar).use(TabbarItem);
  51. Vue.use(Button);
  52. Vue.use(Icon);
  53. // Vue.component('v-loading', Loading);
  54. // Vue.use(Questionnaire)
  55. // Vue.use(animated)
  56. // Vue.use(Tabbar);
  57. // Vue.use(TabbarItem);
  58. redirect()
  59. Login().then(e => {
  60. new Vue({
  61. router,
  62. store,
  63. render: h => h(App),
  64. }).$mount('#app')
  65. }).catch(e => {
  66. console.error(e)
  67. // alert('系统错误, 请刷新重试')
  68. // 重试一次
  69. redirect(true)
  70. })