main.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. import 'babel-polyfill'
  2. import Vue from 'vue'
  3. import App from './App'
  4. import vuex from 'vuex'
  5. import Toast from '@/components/toast/toast'
  6. // import axios from './util/http.js'
  7. // import router from './router'
  8. Vue.prototype.$cdn = 'https://4dscene.4dage.com/new4dkk/'
  9. Vue.use(vuex)
  10. Vue.use(Toast)
  11. Vue.prototype.$bus = new Vue()
  12. let axios = require('./util/http.js').default
  13. let router = require('./router').default
  14. Vue.prototype.$http = axios
  15. // Vue.prototype.$serverName = 'http://192.168.0.10:8080/'
  16. // Vue.prototype.$serverName = 'https://www.4dkankan.com/'
  17. Vue.prototype.$serverName = ''
  18. Vue.config.productionTip = false
  19. function dateFtt (fmt) {
  20. let date = this
  21. let o = {
  22. 'M+': date.getMonth() + 1,
  23. 'd+': date.getDate(),
  24. 'h+': date.getHours(),
  25. 'm+': date.getMinutes(),
  26. 's+': date.getSeconds(),
  27. 'q+': Math.floor((date.getMonth() + 3) / 3),
  28. 'S': date.getMilliseconds()
  29. }
  30. if (/(y+)/.test(fmt)) {
  31. fmt = fmt.replace(
  32. RegExp.$1,
  33. (date.getFullYear() + '').substr(4 - RegExp.$1.length)
  34. )
  35. }
  36. for (let k in o) {
  37. if (new RegExp('(' + k + ')').test(fmt)) {
  38. fmt = fmt.replace(
  39. RegExp.$1,
  40. RegExp.$1.length === 1
  41. ? o[k] : ('00' + o[k]).substr(('' + o[k]).length)
  42. )
  43. }
  44. }
  45. return fmt
  46. }
  47. /* eslint-disable */
  48. Date.prototype.format = dateFtt
  49. /* eslint-enable */
  50. /* eslint-disable no-new */
  51. new Vue({
  52. el: '#app',
  53. router,
  54. store: require('./store').default,
  55. components: { App },
  56. template: '<App/>'
  57. })