main.js 1.4 KB

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