props.js 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. import { defineProps } from '../../libs/util/props';
  2. import theme from '../../libs/config/theme.js'
  3. export default defineProps('codeInput', {
  4. // 输入框类型
  5. type: {
  6. type: String,
  7. default: 'number'
  8. },
  9. // 设置右下角按钮的文字,有效值:send|search|next|go|done,兼容性详见uni-app文档
  10. // https://uniapp.dcloud.io/component/input
  11. // https://uniapp.dcloud.io/component/textarea
  12. confirmType: {
  13. type: String,
  14. default: 'done'
  15. },
  16. // 点击键盘右下角按钮时是否保持键盘不收起,H5无效
  17. confirmHold: {
  18. type: Boolean,
  19. default: false
  20. },
  21. // 键盘弹起时,是否自动上推页面
  22. adjustPosition: {
  23. type: Boolean,
  24. default: true
  25. },
  26. // 最大输入长度
  27. maxlength: {
  28. type: [String, Number],
  29. default: 6
  30. },
  31. // 是否用圆点填充
  32. dot: {
  33. type: Boolean,
  34. default: false
  35. },
  36. // 显示模式,box-盒子模式,line-底部横线模式
  37. mode: {
  38. type: String,
  39. default: 'box'
  40. },
  41. // 是否细边框
  42. hairline: {
  43. type: Boolean,
  44. default: false
  45. },
  46. // 字符间的距离
  47. space: {
  48. type: [String, Number],
  49. default: 10
  50. },
  51. // 预置值
  52. // #ifdef VUE2
  53. value: {
  54. type: [String, Number],
  55. default: ''
  56. },
  57. // #endif
  58. // #ifdef VUE3
  59. modelValue: {
  60. type: [String, Number],
  61. default: ''
  62. },
  63. // #endif
  64. // 是否自动获取焦点
  65. focus: {
  66. type: Boolean,
  67. default: false
  68. },
  69. // 字体是否加粗
  70. bold: {
  71. type: Boolean,
  72. default: false
  73. },
  74. // 字体颜色
  75. color: {
  76. type: String,
  77. default: theme.contentColor
  78. },
  79. // 字体大小
  80. fontSize: {
  81. type: [String, Number],
  82. default: 18
  83. },
  84. // 输入框的大小,宽等于高
  85. size: {
  86. type: [String, Number],
  87. default: 35
  88. },
  89. // 是否隐藏原生键盘,如果想用自定义键盘的话,需设置此参数为true
  90. disabledKeyboard: {
  91. type: Boolean,
  92. default: false
  93. },
  94. // 边框和线条颜色
  95. borderColor: {
  96. type: String,
  97. default: theme.borderColor
  98. },
  99. // 是否禁止输入"."符号
  100. disabledDot: {
  101. type: Boolean,
  102. default: true
  103. },
  104. // 背景颜色
  105. bgColor: {
  106. type: String,
  107. default: ''
  108. },
  109. //设置圆角值
  110. round: {
  111. type: [String, Number],
  112. default: 4
  113. }
  114. })