main.js 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. // The Vue build version to load with the `import` command
  2. // (runtime-only or standalone) has been set in webpack.base.conf with an alias.
  3. import Vue from 'vue'
  4. import App from './App'
  5. import router from './router'
  6. import store from './store'
  7. import { Popup } from 'vant';
  8. import { DatetimePicker } from 'vant';
  9. import { Calendar } from 'vant';
  10. Vue.use(Popup);
  11. Vue.use(DatetimePicker);
  12. Vue.use(Calendar);
  13. import 'lib-flexible'
  14. Vue.config.productionTip = false
  15. import preview from 'vue-photo-preview'
  16. import 'vue-photo-preview/dist/skin.css'
  17. Vue.use(preview)
  18. import AmapVue from '@amap/amap-vue'
  19. AmapVue.config.key = '3d9ce5fb1194cb4de7d48260eecefd00'
  20. Vue.use(AmapVue)
  21. let options = {
  22. fullscreenEl: false,
  23. }
  24. Vue.use(preview, options)
  25. router.beforeEach((to, from, next) => {
  26. /* 路由发生变化修改页面title */
  27. if (to.meta.title) {
  28. document.title = to.meta.title
  29. }
  30. next()
  31. })
  32. /* eslint-disable no-new */
  33. new Vue({
  34. el: '#app',
  35. router,
  36. store,
  37. components: { App },
  38. template: '<App/>'
  39. })