props.js 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. import defprops from '../../libs/config/props';
  2. export default {
  3. props: {
  4. // 步进器标识符,在change回调返回
  5. name: {
  6. type: [String, Number],
  7. default: defprops.numberBox.name
  8. },
  9. // #ifdef VUE2
  10. // 用于双向绑定的值,初始化时设置设为默认min值(最小值)
  11. value: {
  12. type: [String, Number],
  13. default: defprops.numberBox.value
  14. },
  15. // #endif
  16. // #ifdef VUE3
  17. // 用于双向绑定的值,初始化时设置设为默认min值(最小值)
  18. modelValue: {
  19. type: [String, Number],
  20. default: defprops.numberBox.value
  21. },
  22. // #endif
  23. // 最小值
  24. min: {
  25. type: [String, Number],
  26. default: defprops.numberBox.min
  27. },
  28. // 最大值
  29. max: {
  30. type: [String, Number],
  31. default: defprops.numberBox.max
  32. },
  33. // 加减的步长,可为小数
  34. step: {
  35. type: [String, Number],
  36. default: defprops.numberBox.step
  37. },
  38. // 是否只允许输入整数
  39. integer: {
  40. type: Boolean,
  41. default: defprops.numberBox.integer
  42. },
  43. // 是否禁用,包括输入框,加减按钮
  44. disabled: {
  45. type: Boolean,
  46. default: defprops.numberBox.disabled
  47. },
  48. // 是否禁用输入框
  49. disabledInput: {
  50. type: Boolean,
  51. default: defprops.numberBox.disabledInput
  52. },
  53. // 是否开启异步变更,开启后需要手动控制输入值
  54. asyncChange: {
  55. type: Boolean,
  56. default: defprops.numberBox.asyncChange
  57. },
  58. // 输入框宽度,单位为px
  59. inputWidth: {
  60. type: [String, Number],
  61. default: defprops.numberBox.inputWidth
  62. },
  63. // 是否显示减少按钮
  64. showMinus: {
  65. type: Boolean,
  66. default: defprops.numberBox.showMinus
  67. },
  68. // 是否显示增加按钮
  69. showPlus: {
  70. type: Boolean,
  71. default: defprops.numberBox.showPlus
  72. },
  73. // 显示的小数位数
  74. decimalLength: {
  75. type: [String, Number, null],
  76. default: defprops.numberBox.decimalLength
  77. },
  78. // 是否开启长按加减手势
  79. longPress: {
  80. type: Boolean,
  81. default: defprops.numberBox.longPress
  82. },
  83. // 输入框文字和加减按钮图标的颜色
  84. color: {
  85. type: String,
  86. default: defprops.numberBox.color
  87. },
  88. // 按钮大小,宽高等于此值,单位px,输入框高度和此值保持一致
  89. buttonSize: {
  90. type: [String, Number],
  91. default: defprops.numberBox.buttonSize
  92. },
  93. // 输入框和按钮的背景颜色
  94. bgColor: {
  95. type: String,
  96. default: defprops.numberBox.bgColor
  97. },
  98. // 指定光标于键盘的距离,避免键盘遮挡输入框,单位px
  99. cursorSpacing: {
  100. type: [String, Number],
  101. default: defprops.numberBox.cursorSpacing
  102. },
  103. // 是否禁用增加按钮
  104. disablePlus: {
  105. type: Boolean,
  106. default: defprops.numberBox.disablePlus
  107. },
  108. // 是否禁用减少按钮
  109. disableMinus: {
  110. type: Boolean,
  111. default: defprops.numberBox.disableMinus
  112. },
  113. // 加减按钮图标的样式
  114. iconStyle: {
  115. type: [Object, String],
  116. default: defprops.numberBox.iconStyle
  117. }
  118. }
  119. }