props.js 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. import { defineMixin } from '../../libs/vue'
  2. import defProps from '../../libs/config/props.js'
  3. export const props = defineMixin({
  4. props: {
  5. // 最小可选值
  6. min: {
  7. type: [Number, String],
  8. default: () => defProps.slider.min
  9. },
  10. // 最大可选值
  11. max: {
  12. type: [Number, String],
  13. default: () => defProps.slider.max
  14. },
  15. // 步长,取值必须大于 0,并且可被(max - min)整除
  16. step: {
  17. type: [Number, String],
  18. default: () => defProps.slider.step
  19. },
  20. // #ifdef VUE3
  21. // 当前取值
  22. modelValue: {
  23. type: [String, Number],
  24. default: () => defProps.slider.value
  25. },
  26. // #endif
  27. // #ifdef VUE2
  28. // 当前取值
  29. value: {
  30. type: [String, Number],
  31. default: () => defProps.slider.value
  32. },
  33. // #endif
  34. // 是否区间模式
  35. isRange: {
  36. type: Boolean,
  37. default: false
  38. },
  39. // 双滑块时值
  40. rangeValue: {
  41. type: [Array],
  42. default: [0, 0]
  43. },
  44. // 滑块右侧已选择部分的背景色
  45. activeColor: {
  46. type: String,
  47. default: () => defProps.slider.activeColor
  48. },
  49. // 滑块左侧未选择部分的背景色
  50. inactiveColor: {
  51. type: String,
  52. default: () => defProps.slider.inactiveColor
  53. },
  54. // 滑块的大小,取值范围为 12 - 28
  55. blockSize: {
  56. type: [Number, String],
  57. default: () => defProps.slider.blockSize
  58. },
  59. // 滑块的颜色
  60. blockColor: {
  61. type: String,
  62. default: () => defProps.slider.blockColor
  63. },
  64. // 用户对滑块的自定义颜色
  65. blockStyle: {
  66. type: Object,
  67. default: () => defProps.slider.blockStyle
  68. },
  69. // 禁用状态
  70. disabled: {
  71. type: Boolean,
  72. default: () => defProps.slider.disabled
  73. },
  74. // 是否显示当前的选择值
  75. showValue: {
  76. type: Boolean,
  77. default: () => defProps.slider.showValue
  78. },
  79. // 是否渲染uni-app框架内置组件
  80. useNative: {
  81. type: Boolean,
  82. default: () => defProps.slider.useNative
  83. },
  84. // 滑块高度
  85. height: {
  86. type: String,
  87. default: () => defProps.slider.height
  88. }
  89. }
  90. })