props.js 4.5 KB

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