props.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. import { defineProps } from '../../libs/util/props';
  2. import theme from '../../libs/config/theme.js'
  3. export default defineProps('dateStrip', {
  4. // #ifdef VUE2
  5. value: {
  6. type: Number,
  7. default: 0,
  8. },
  9. // #endif
  10. // #ifdef VUE3
  11. modelValue: {
  12. type: Number,
  13. default: 0,
  14. },
  15. // #endif
  16. // 默认选中的日期
  17. defaultDate: {
  18. type: [String, Number],
  19. default: '',
  20. },
  21. // 切换模式:none 平铺展示所有日期,不展示切换按钮,week 按周方式切换
  22. mode: {
  23. type: String,
  24. default: 'week',
  25. },
  26. // 可选择的最小日期
  27. minDate: {
  28. type: Number,
  29. default: 0,
  30. },
  31. // 可选择的最大日期
  32. maxDate: {
  33. type: Number,
  34. default: 0,
  35. },
  36. // 插件高度
  37. height: {
  38. type: String,
  39. default: '55px',
  40. },
  41. // 每格日期宽度,
  42. itemWidth: {
  43. type: String,
  44. default: '50px',
  45. },
  46. // 每格日期圆角,
  47. itemRound: {
  48. type: String,
  49. default: '6px',
  50. },
  51. // 选中框背景色
  52. activeBgColor: {
  53. type: String,
  54. default: theme.primary,
  55. },
  56. // 选中框文本色
  57. activeColor: {
  58. type: String,
  59. default: '#ffffff',
  60. },
  61. // 选中框样式
  62. activeStyle: {
  63. type: Object,
  64. default: () => ({})
  65. },
  66. // 横条背景色
  67. bgColor: {
  68. type: String,
  69. default: '',
  70. },
  71. // 选中框圆角
  72. round: {
  73. type: String,
  74. default: '',
  75. },
  76. // 第一天从星期几开始,默认 0 = 周日
  77. firstDayOfWeek: {
  78. type: Number,
  79. default: 0,
  80. },
  81. // 高亮模式:'both' 同时高亮星期和日期,'date' 只高亮日期,'text' 只高亮文本
  82. activeMode: {
  83. type: String,
  84. default: 'both',
  85. },
  86. // 日期格式化函数
  87. formatter: {
  88. type: [Function, null],
  89. default: null,
  90. },
  91. // 最多展示月份数量
  92. monthNum: {
  93. type: [Number, String],
  94. default: 1
  95. },
  96. // 禁止选择的日期函数
  97. disabledFun: {
  98. type: [Function, null],
  99. default: null
  100. },
  101. // 禁止选择的日期
  102. disabledDate: {
  103. type: [Array, String, null],
  104. default: null
  105. },
  106. // 禁用日期的文字颜色
  107. disabledColor: {
  108. type: String,
  109. default: theme.disabledColor
  110. },
  111. // 是否显示农历
  112. showLunar: {
  113. type: Boolean,
  114. default: false
  115. },
  116. // 是否对小于10的数字补0
  117. padZero: {
  118. type: Boolean,
  119. default: false
  120. }
  121. })