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.

90 lines
2.5 KiB

2 months ago
  1. import { defineMixin } from '../../libs/vue'
  2. import defProps from '../../libs/config/props.js'
  3. export const props = defineMixin({
  4. props: {
  5. // 键盘弹起时,是否自动上推页面
  6. adjustPosition: {
  7. type: Boolean,
  8. default: () => defProps.codeInput.adjustPosition
  9. },
  10. // 最大输入长度
  11. maxlength: {
  12. type: [String, Number],
  13. default: () => defProps.codeInput.maxlength
  14. },
  15. // 是否用圆点填充
  16. dot: {
  17. type: Boolean,
  18. default: () => defProps.codeInput.dot
  19. },
  20. // 显示模式,box-盒子模式,line-底部横线模式
  21. mode: {
  22. type: String,
  23. default: () => defProps.codeInput.mode
  24. },
  25. // 是否细边框
  26. hairline: {
  27. type: Boolean,
  28. default: () => defProps.codeInput.hairline
  29. },
  30. // 字符间的距离
  31. space: {
  32. type: [String, Number],
  33. default: () => defProps.codeInput.space
  34. },
  35. // #ifdef VUE3
  36. // 预置值
  37. modelValue: {
  38. type: [String, Number],
  39. default: () => defProps.codeInput.value
  40. },
  41. // #endif
  42. // #ifdef VUE2
  43. // 预置值
  44. value: {
  45. type: [String, Number],
  46. default: () => defProps.codeInput.value
  47. },
  48. // #endif
  49. // 是否自动获取焦点
  50. focus: {
  51. type: Boolean,
  52. default: () => defProps.codeInput.focus
  53. },
  54. // 字体是否加粗
  55. bold: {
  56. type: Boolean,
  57. default: () => defProps.codeInput.bold
  58. },
  59. // 字体颜色
  60. color: {
  61. type: String,
  62. default: () => defProps.codeInput.color
  63. },
  64. // 字体大小
  65. fontSize: {
  66. type: [String, Number],
  67. default: () => defProps.codeInput.fontSize
  68. },
  69. // 输入框的大小,宽等于高
  70. size: {
  71. type: [String, Number],
  72. default: () => defProps.codeInput.size
  73. },
  74. // 是否隐藏原生键盘,如果想用自定义键盘的话,需设置此参数为true
  75. disabledKeyboard: {
  76. type: Boolean,
  77. default: () => defProps.codeInput.disabledKeyboard
  78. },
  79. // 边框和线条颜色
  80. borderColor: {
  81. type: String,
  82. default: () => defProps.codeInput.borderColor
  83. },
  84. // 是否禁止输入"."符号
  85. disabledDot: {
  86. type: Boolean,
  87. default: () => defProps.codeInput.disabledDot
  88. }
  89. }
  90. })