main.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import Vue from 'vue'
  2. import App from './App'
  3. import http from 'http.js'
  4. import verified from 'verified.js'
  5. import store from './store'
  6. import Moment from './static/moment.js'
  7. // import VueQuillEditor from 'vue-quill-editor'
  8. // // require styles
  9. // import 'quill/dist/quill.core.css'
  10. // import 'quill/dist/quill.snow.css'
  11. // import 'quill/dist/quill.bubble.css'
  12. // Vue.use(VueQuillEditor)
  13. Vue.prototype.$http = http
  14. Vue.prototype.$verified = verified
  15. Vue.prototype.$store = store
  16. Vue.config.productionTip = false
  17. App.mpType = 'app'
  18. Vue.filter('imagesFilter', (images) => {
  19. let image = '';
  20. if (images) {
  21. image = images.split(',')[0]
  22. }
  23. if (image.indexOf("http") !== 0) {
  24. image = http.baseUrl + image;
  25. }
  26. return image;
  27. })
  28. Vue.filter('priceFilter', (price) => {
  29. return Number(price).toFixed(2);
  30. })
  31. Vue.filter('datetimeFilter', (value) => {
  32. var datetimeFormat = 'YYYY-MM-DD HH:mm:ss'
  33. if (isNaN(value)) {
  34. return value ? Moment(value).format(datetimeFormat) : '';
  35. } else {
  36. return value ? Moment(parseInt(value) * 1000).format(datetimeFormat) :'None';
  37. }
  38. })
  39. const app = new Vue({
  40. ...App,
  41. store
  42. })
  43. app.$mount()