props.js 2.8 KB

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