index.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. import Vue from 'vue'
  2. import router from './router'
  3. import store from './store'
  4. // import { sync } from 'vuex-router-sync'
  5. import Meta from 'vue-meta'
  6. import InfiniteLoading from 'vue-infinite-loading'
  7. import VueScrollTo from 'vue-scrollto'
  8. import VueSelect from 'vue-select'
  9. import Vue2TouchEvents from 'vue2-touch-events'
  10. import VueClipboard from 'vue-clipboard2'
  11. import VueSweetalert2 from 'vue-sweetalert2'
  12. import App from './App'
  13. import 'assets/css/mdi/css/materialdesignicons.css'
  14. // import 'mdi/font'
  15. import 'vue-select/src/scss/vue-select.scss'
  16. import 'sweetalert2/dist/sweetalert2.min.css'
  17. import '@sweetalert2/themes/dark/dark.scss'
  18. import 'assets/css/app.scss'
  19. Vue.use(Meta)
  20. Vue.use(InfiniteLoading, {
  21. props: {
  22. spinner: 'spiral'
  23. },
  24. slots: {
  25. noMore: '',
  26. noResults: '',
  27. error: ''
  28. }
  29. // system: {
  30. // throttleLimit: 50,
  31. // /* other settings need to configure */
  32. // }
  33. })
  34. Vue.use(VueScrollTo)
  35. Vue.component('v-select', VueSelect)
  36. Vue.use(Vue2TouchEvents)
  37. Vue.use(VueClipboard)
  38. Vue.use(VueSweetalert2)
  39. // https://apple.stackexchange.com/questions/17077/add-a-hosts-file-entry-without-jailbreaking
  40. // window.apipath = process.env === 'prod' || window.location.hostname === 'dev.gdp.fr' ? `http://${window.location.hostname}/api` : 'http://localhost:8984'
  41. if (process.env === 'prod') {
  42. window.apipath = `https://api.guidesdeparis.fr`
  43. } else if (window.location.hostname === 'dev.gdp.fr') {
  44. window.apipath = `http://${window.location.hostname}/api`
  45. } else {
  46. window.apipath = 'http://localhost:8984'
  47. }
  48. // if (window.location.hostname === 'dev.gdp.fr') {
  49. // window.apipath = `http://${window.location.hostname}/api`
  50. // }
  51. // window.apipath = `http://${window.location.hostname}:8984`
  52. // sync(store, router) // done. Returns an unsync callback fn
  53. new Vue({
  54. router,
  55. store,
  56. render: h => h(App)
  57. }).$mount('#app')