props.js 4.0 KB

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