main.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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,format) => {
  32. var datetimeFormat = 'YYYY-MM-DD HH:mm:ss'
  33. if(format){
  34. datetimeFormat = format
  35. }
  36. if (isNaN(value)) {
  37. return value ? Moment(value).format(datetimeFormat) : '';
  38. } else {
  39. return value ? Moment(parseInt(value) * 1000).format(datetimeFormat) :'None';
  40. }
  41. })
  42. const app = new Vue({
  43. ...App,
  44. store
  45. })
  46. app.$mount()