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

94 строки
2.6 KiB

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