Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 

149 строки
4.7 KiB

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