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.

98 lines
2.9 KiB

5 months ago
  1. import { defineMixin } from '../../libs/vue'
  2. import defProps from '../../libs/config/props.js'
  3. export const props = defineMixin({
  4. props: {
  5. modelValue: {
  6. type: Array,
  7. default: () => []
  8. },
  9. hasInput: {
  10. type: Boolean,
  11. default: false
  12. },
  13. placeholder: {
  14. type: String,
  15. default: () => '请选择'
  16. },
  17. // 是否展示picker弹窗
  18. show: {
  19. type: Boolean,
  20. default: () => defProps.picker.show
  21. },
  22. // 弹出的方向,可选值为 top bottom right left center
  23. popupMode: {
  24. type: String,
  25. default: () => defProps.picker.popupMode
  26. },
  27. // 是否展示顶部的操作栏
  28. showToolbar: {
  29. type: Boolean,
  30. default: () => defProps.picker.showToolbar
  31. },
  32. // 顶部标题
  33. title: {
  34. type: String,
  35. default: () => defProps.picker.title
  36. },
  37. // 对象数组,设置每一列的数据
  38. columns: {
  39. type: Array,
  40. default: () => defProps.picker.columns
  41. },
  42. // 是否显示加载中状态
  43. loading: {
  44. type: Boolean,
  45. default: () => defProps.picker.loading
  46. },
  47. // 各列中,单个选项的高度
  48. itemHeight: {
  49. type: [String, Number],
  50. default: () => defProps.picker.itemHeight
  51. },
  52. // 取消按钮的文字
  53. cancelText: {
  54. type: String,
  55. default: () => defProps.picker.cancelText
  56. },
  57. // 确认按钮的文字
  58. confirmText: {
  59. type: String,
  60. default: () => defProps.picker.confirmText
  61. },
  62. // 取消按钮的颜色
  63. cancelColor: {
  64. type: String,
  65. default: () => defProps.picker.cancelColor
  66. },
  67. // 确认按钮的颜色
  68. confirmColor: {
  69. type: String,
  70. default: () => defProps.picker.confirmColor
  71. },
  72. // 每列中可见选项的数量
  73. visibleItemCount: {
  74. type: [String, Number],
  75. default: () => defProps.picker.visibleItemCount
  76. },
  77. // 选项对象中,需要展示的属性键名
  78. keyName: {
  79. type: String,
  80. default: () => defProps.picker.keyName
  81. },
  82. // 是否允许点击遮罩关闭选择器
  83. closeOnClickOverlay: {
  84. type: Boolean,
  85. default: () => defProps.picker.closeOnClickOverlay
  86. },
  87. // 各列的默认索引
  88. defaultIndex: {
  89. type: Array,
  90. default: () => defProps.picker.defaultIndex
  91. },
  92. // 是否在手指松开时立即触发 change 事件。若不开启则会在滚动动画结束后触发 change 事件,只在微信2.21.1及以上有效
  93. immediateChange: {
  94. type: Boolean,
  95. default: () => defProps.picker.immediateChange
  96. }
  97. }
  98. })