index.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. // 混淆函数库
  2. import mixin from './tool/mixin/mixin.js'
  3. import dayjs from './tool/function/dayjs/index'
  4. import util from './tool/function/util'
  5. // 生成全局唯一guid字符串
  6. import guid from './tool/function/guid.js'
  7. // 延迟函数
  8. import sleep from './tool/function/sleep.js'
  9. // 打乱数组的顺序
  10. import randomArray from './tool/function/randomArray.js'
  11. // 对象和数组的深度克隆
  12. import deepClone from './tool/function/deepClone.js'
  13. // 对象深度拷贝
  14. import deepMerge from './tool/function/deepMerge.js'
  15. // 规则检验
  16. import test from './tool/function/test.js'
  17. // 随机数
  18. import random from './tool/function/random.js'
  19. // 去除空格
  20. import trim from './tool/function/trim.js'
  21. // toast提示,对uni.showToast的封装
  22. import toast from './tool/function/toast.js'
  23. // 获取父组件参数
  24. import getParent from './tool/function/getParent.js'
  25. // -----自定获取组件上的属性。
  26. import getParentAttr from './tool/function/getParentAttr.js'
  27. // -----自定获取单个父组件
  28. import getParentAls from './tool/function/getParentAls.js'
  29. // 上传文件库
  30. import upload from './tool/function/upload.js'
  31. // 预览文件
  32. import preview from './tool/function/preview.js'
  33. // obj转字样式style符串。 // -----自定
  34. import {objToString} from './tool/function/objToString.js'
  35. // 日历库
  36. import calendar from './tool/function/calendar.js'
  37. import HandwritingSelf from './tool/function/signBoard.js'
  38. //抽奖模型。
  39. import choujiang from './tool/function/choujianggailv.js'
  40. // 配置信息
  41. import config from './tool/config/config.js'
  42. import store from './tool/store/tm-vuetify'
  43. import vx from './tool/function/vuex.js'
  44. import theme from './tool/function/theme.js'
  45. import request from './tool/request/index'
  46. const $tm = {
  47. sleep,
  48. request,
  49. objToString,
  50. dayjs:dayjs.dayjs,
  51. guid,
  52. upload,
  53. preview,
  54. randomArray,
  55. test,
  56. random,
  57. deepClone,
  58. deepMerge,
  59. getParent,
  60. getParentAttr,
  61. getParentAls,
  62. trim,
  63. toast,
  64. config,
  65. calendar,
  66. HandwritingSelf,
  67. choujiang,
  68. vx:new vx(store),
  69. theme,
  70. u: util,
  71. }
  72. uni.$tm = $tm
  73. const install = Vue => {
  74. Vue.mixin(mixin)
  75. Vue.prototype.$tm = {...$tm}
  76. // Vue.prototype.$store = store
  77. }
  78. export default {
  79. install
  80. }