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