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.

147 lines
4.7 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. // 日历顶部标题
  6. title: {
  7. type: String,
  8. default: () => defProps.calendar.title
  9. },
  10. // 是否显示标题
  11. showTitle: {
  12. type: Boolean,
  13. default: () => defProps.calendar.showTitle
  14. },
  15. // 是否显示副标题
  16. showSubtitle: {
  17. type: Boolean,
  18. default: () => defProps.calendar.showSubtitle
  19. },
  20. // 日期类型选择,single-选择单个日期,multiple-可以选择多个日期,range-选择日期范围
  21. mode: {
  22. type: String,
  23. default: () => defProps.calendar.mode
  24. },
  25. // mode=range时,第一个日期底部的提示文字
  26. startText: {
  27. type: String,
  28. default: () => defProps.calendar.startText
  29. },
  30. // mode=range时,最后一个日期底部的提示文字
  31. endText: {
  32. type: String,
  33. default: () => defProps.calendar.endText
  34. },
  35. // 自定义列表
  36. customList: {
  37. type: Array,
  38. default: () => defProps.calendar.customList
  39. },
  40. // 主题色,对底部按钮和选中日期有效
  41. color: {
  42. type: String,
  43. default: () => defProps.calendar.color
  44. },
  45. // 最小的可选日期
  46. minDate: {
  47. type: [String, Number],
  48. default: () => defProps.calendar.minDate
  49. },
  50. // 最大可选日期
  51. maxDate: {
  52. type: [String, Number],
  53. default: () => defProps.calendar.maxDate
  54. },
  55. // 默认选中的日期,mode为multiple或range是必须为数组格式
  56. defaultDate: {
  57. type: [Array, String, Date, null],
  58. default: () => defProps.calendar.defaultDate
  59. },
  60. // mode=multiple时,最多可选多少个日期
  61. maxCount: {
  62. type: [String, Number],
  63. default: () => defProps.calendar.maxCount
  64. },
  65. // 日期行高
  66. rowHeight: {
  67. type: [String, Number],
  68. default: () => defProps.calendar.rowHeight
  69. },
  70. // 日期格式化函数
  71. formatter: {
  72. type: [Function, null],
  73. default: () => defProps.calendar.formatter
  74. },
  75. // 是否显示农历
  76. showLunar: {
  77. type: Boolean,
  78. default: () => defProps.calendar.showLunar
  79. },
  80. // 是否显示月份背景色
  81. showMark: {
  82. type: Boolean,
  83. default: () => defProps.calendar.showMark
  84. },
  85. // 确定按钮的文字
  86. confirmText: {
  87. type: String,
  88. default: () => defProps.calendar.confirmText
  89. },
  90. // 确认按钮处于禁用状态时的文字
  91. confirmDisabledText: {
  92. type: String,
  93. default: () => defProps.calendar.confirmDisabledText
  94. },
  95. // 是否显示日历弹窗
  96. show: {
  97. type: Boolean,
  98. default: () => defProps.calendar.show
  99. },
  100. // 是否允许点击遮罩关闭日历
  101. closeOnClickOverlay: {
  102. type: Boolean,
  103. default: () => defProps.calendar.closeOnClickOverlay
  104. },
  105. // 是否为只读状态,只读状态下禁止选择日期
  106. readonly: {
  107. type: Boolean,
  108. default: () => defProps.calendar.readonly
  109. },
  110. // 是否展示确认按钮
  111. showConfirm: {
  112. type: Boolean,
  113. default: () => defProps.calendar.showConfirm
  114. },
  115. // 日期区间最多可选天数,默认无限制,mode = range时有效
  116. maxRange: {
  117. type: [Number, String],
  118. default: () => defProps.calendar.maxRange
  119. },
  120. // 范围选择超过最多可选天数时的提示文案,mode = range时有效
  121. rangePrompt: {
  122. type: String,
  123. default: () => defProps.calendar.rangePrompt
  124. },
  125. // 范围选择超过最多可选天数时,是否展示提示文案,mode = range时有效
  126. showRangePrompt: {
  127. type: Boolean,
  128. default: () => defProps.calendar.showRangePrompt
  129. },
  130. // 是否允许日期范围的起止时间为同一天,mode = range时有效
  131. allowSameDay: {
  132. type: Boolean,
  133. default: () => defProps.calendar.allowSameDay
  134. },
  135. // 圆角值
  136. round: {
  137. type: [Boolean, String, Number],
  138. default: () => defProps.calendar.round
  139. },
  140. // 最多展示月份数量
  141. monthNum: {
  142. type: [Number, String],
  143. default: 3
  144. }
  145. }
  146. })