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.

145 lines
4.5 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. // 是否显示input
  6. hasInput: {
  7. type: Boolean,
  8. default: () => false
  9. },
  10. placeholder: {
  11. type: String,
  12. default: () => '请选择'
  13. },
  14. format: {
  15. type: String,
  16. default: () => ''
  17. },
  18. // 是否打开组件
  19. show: {
  20. type: Boolean,
  21. default: () => defProps.datetimePicker.show
  22. },
  23. // 弹出的方向,可选值为 top bottom right left center
  24. popupMode: {
  25. type: String,
  26. default: () => defProps.picker.popupMode
  27. },
  28. // 是否展示顶部的操作栏
  29. showToolbar: {
  30. type: Boolean,
  31. default: () => defProps.datetimePicker.showToolbar
  32. },
  33. // #ifdef VUE2
  34. // 绑定值
  35. value: {
  36. type: [String, Number],
  37. default: () => defProps.datetimePicker.value
  38. },
  39. // #endif
  40. // #ifdef VUE3
  41. // 绑定值
  42. modelValue: {
  43. type: [String, Number],
  44. default: () => defProps.datetimePicker.value
  45. },
  46. // #endif
  47. // 顶部标题
  48. title: {
  49. type: String,
  50. default: () => defProps.datetimePicker.title
  51. },
  52. // 展示格式,mode=date为日期选择,mode=time为时间选择,mode=year-month为年月选择,mode=datetime为日期时间选择
  53. mode: {
  54. type: String,
  55. default: () => defProps.datetimePicker.mode
  56. },
  57. // 可选的最大时间
  58. maxDate: {
  59. type: Number,
  60. // 最大默认值为后10年
  61. default: () => defProps.datetimePicker.maxDate
  62. },
  63. // 可选的最小时间
  64. minDate: {
  65. type: Number,
  66. // 最小默认值为前10年
  67. default: () => defProps.datetimePicker.minDate
  68. },
  69. // 可选的最小小时,仅mode=time有效
  70. minHour: {
  71. type: Number,
  72. default: () => defProps.datetimePicker.minHour
  73. },
  74. // 可选的最大小时,仅mode=time有效
  75. maxHour: {
  76. type: Number,
  77. default: () => defProps.datetimePicker.maxHour
  78. },
  79. // 可选的最小分钟,仅mode=time有效
  80. minMinute: {
  81. type: Number,
  82. default: () => defProps.datetimePicker.minMinute
  83. },
  84. // 可选的最大分钟,仅mode=time有效
  85. maxMinute: {
  86. type: Number,
  87. default: () => defProps.datetimePicker.maxMinute
  88. },
  89. // 选项过滤函数
  90. filter: {
  91. type: [Function, null],
  92. default: () => defProps.datetimePicker.filter
  93. },
  94. // 选项格式化函数
  95. formatter: {
  96. type: [Function, null],
  97. default: () => defProps.datetimePicker.formatter
  98. },
  99. // 是否显示加载中状态
  100. loading: {
  101. type: Boolean,
  102. default: () => defProps.datetimePicker.loading
  103. },
  104. // 各列中,单个选项的高度
  105. itemHeight: {
  106. type: [String, Number],
  107. default: () => defProps.datetimePicker.itemHeight
  108. },
  109. // 取消按钮的文字
  110. cancelText: {
  111. type: String,
  112. default: () => defProps.datetimePicker.cancelText
  113. },
  114. // 确认按钮的文字
  115. confirmText: {
  116. type: String,
  117. default: () => defProps.datetimePicker.confirmText
  118. },
  119. // 取消按钮的颜色
  120. cancelColor: {
  121. type: String,
  122. default: () => defProps.datetimePicker.cancelColor
  123. },
  124. // 确认按钮的颜色
  125. confirmColor: {
  126. type: String,
  127. default: () => defProps.datetimePicker.confirmColor
  128. },
  129. // 每列中可见选项的数量
  130. visibleItemCount: {
  131. type: [String, Number],
  132. default: () => defProps.datetimePicker.visibleItemCount
  133. },
  134. // 是否允许点击遮罩关闭选择器
  135. closeOnClickOverlay: {
  136. type: Boolean,
  137. default: () => defProps.datetimePicker.closeOnClickOverlay
  138. },
  139. // 各列的默认索引
  140. defaultIndex: {
  141. type: Array,
  142. default: () => defProps.datetimePicker.defaultIndex
  143. }
  144. }
  145. })