MES手机端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

71 lines
1.6 KiB

  1. // 引入全局mixin
  2. import mixin from './libs/mixin/mixin.js'
  3. // 调试输出信息
  4. function wranning(str) {
  5. // 开发环境进行信息输出,主要是一些报错信息
  6. // 这个环境的来由是在程序编写时候,点击hx编辑器运行调试代码的时候,详见:
  7. // https://uniapp.dcloud.io/frame?id=%e5%bc%80%e5%8f%91%e7%8e%af%e5%a2%83%e5%92%8c%e7%94%9f%e4%ba%a7%e7%8e%af%e5%a2%83
  8. if (process.env.NODE_ENV === 'development') {
  9. console.warn(str)
  10. }
  11. }
  12. // 更新自定义状态栏的信息
  13. import updateCustomBarInfo from './libs/function/updateCustomBarInfo.js'
  14. // 获取颜色工具
  15. import color from './libs/function/color.js'
  16. // 消息工具
  17. import message from './libs/function/message.js'
  18. // 获取唯一id
  19. import uuid from './libs/function/uuid.js'
  20. // 数组工具
  21. import array from './libs/function/array.js'
  22. // 规则检验
  23. import test from './libs/function/test.js'
  24. // 获取整个父组件
  25. import $parent from './libs/function/$parent.js'
  26. // 格式化字符串工具
  27. import string from './libs/function/string.js'
  28. // 格式化数值工具
  29. import number from './libs/function/number.js'
  30. // 深度复制
  31. import deepClone from './libs/function/deepClone.js'
  32. // z-index配置信息
  33. import zIndex from './libs/config/zIndex.js'
  34. // 主题颜色信息
  35. import colorInfo from './libs/config/color.js'
  36. const $t = {
  37. updateCustomBar: updateCustomBarInfo,
  38. color,
  39. message,
  40. uuid,
  41. array,
  42. test,
  43. $parent,
  44. string,
  45. number,
  46. deepClone,
  47. zIndex,
  48. colorInfo,
  49. }
  50. // 挂载到uni对象上
  51. uni.$t = $t
  52. const install = Vue => {
  53. // 全局混入
  54. Vue.mixin(mixin)
  55. // Filter格式化
  56. Vue.prototype.$t = $t
  57. }
  58. export default {
  59. install
  60. }