main.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. import Vue from "vue";
  2. import App from "./App";
  3. import constants from "@/constant/index";
  4. Vue.prototype.$constant = constants;
  5. import "@/filters/index";
  6. import util from "./utils/util";
  7. Vue.prototype.$util = util;
  8. import globalMixins from "./mixins/globalMixins";
  9. Vue.mixin(globalMixins);
  10. import kdEntrance from "@/components/kd_entrance";
  11. Vue.component('kd-entrance', kdEntrance)
  12. import store from "./store";
  13. Vue.prototype.$store = store;
  14. // 阻止启动生产消息,常用作指令
  15. Vue.config.productionTip = false;
  16. // 封装得全局消息提示
  17. Vue.prototype.$msg = title =>
  18. uni.showToast({
  19. title,
  20. icon: "none"
  21. });
  22. // 生产环境中控制台不打印普通信息,以免造成内存泄漏
  23. if (process.env.NODE_ENV == "production") {
  24. if (console) {
  25. console.log = () => {};
  26. }
  27. }
  28. // Vue.prototype.$backgroundAudioData = {
  29. // playing: false,
  30. // playTime: 0,
  31. // formatedPlayTime: '00:00:00'
  32. // }
  33. // Vue.component('page-head', pageHead)
  34. // Vue.component('page-foot', pageFoot)
  35. // Vue.component('uLink', uLink)
  36. import tTable from "@/components/plugin/t-table/t-table.vue";
  37. import tTh from "@/components/plugin/t-table/t-th.vue";
  38. import tTr from "@/components/plugin/t-table/t-tr.vue";
  39. import tTd from "@/components/plugin/t-table/t-td.vue";
  40. Vue.component("t-table", tTable);
  41. Vue.component("t-tr", tTr);
  42. Vue.component("t-th", tTh);
  43. Vue.component("t-td", tTd);
  44. App.mpType = "app";
  45. const app = new Vue({
  46. store,
  47. ...App
  48. });
  49. app.$mount();