props.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. export default {
  2. props: {
  3. // 键盘的类型,number-数字键盘,card-身份证键盘,car-车牌号键盘
  4. mode: {
  5. type: String,
  6. default: 'number'
  7. },
  8. // 是否显示键盘的"."符号
  9. dotDisabled: {
  10. type: Boolean,
  11. default: false
  12. },
  13. // 是否显示顶部工具条
  14. tooltip: {
  15. type: Boolean,
  16. default: true
  17. },
  18. // 是否显示工具条中间的提示
  19. showTips: {
  20. type: Boolean,
  21. default: true
  22. },
  23. // 工具条中间的提示文字
  24. tips: {
  25. type: String,
  26. default: ''
  27. },
  28. // 是否显示工具条左边的"取消"按钮
  29. showCancel: {
  30. type: Boolean,
  31. default: true
  32. },
  33. // 是否显示工具条右边的"完成"按钮
  34. showConfirm: {
  35. type: Boolean,
  36. default: true
  37. },
  38. // 是否打乱键盘按键的顺序
  39. random: {
  40. type: Boolean,
  41. default: false
  42. },
  43. // 是否开启底部安全区适配,开启的话,会在iPhoneX机型底部添加一定的内边距
  44. safeAreaInsetBottom: {
  45. type: Boolean,
  46. default: true
  47. },
  48. // 是否允许通过点击遮罩关闭键盘
  49. closeOnClickOverlay: {
  50. type: Boolean,
  51. default: true
  52. },
  53. // 是否允许点击确认按钮关闭组件
  54. closeOnClickConfirm: {
  55. type: Boolean,
  56. default: true
  57. },
  58. // 是否显示遮罩,某些时候数字键盘时,用户希望看到自己的数值,所以可能不想要遮罩
  59. overlay: {
  60. type: Boolean,
  61. default: true
  62. },
  63. // z-index值
  64. zIndex: {
  65. type: [String, Number],
  66. default: 10075
  67. },
  68. // 取消按钮的文字
  69. cancelText: {
  70. type: String,
  71. default: '取消'
  72. },
  73. // 确认按钮的文字
  74. confirmText: {
  75. type: String,
  76. default: '确定'
  77. },
  78. // 输入一个中文后,是否自动切换到英文
  79. autoChange: {
  80. type: Boolean,
  81. default: false
  82. },
  83. // 被禁用的键
  84. disKeys: {
  85. type: Array,
  86. default: ()=>[]
  87. },
  88. // 是否自定义abc
  89. customabc: {
  90. type: Boolean,
  91. default: false
  92. },
  93. ...uni.$uv?.props?.keyboard
  94. }
  95. }