3
0

props.js 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. import { defineMixin } from '../../libs/vue'
  2. import defProps from '../../libs/config/props.js'
  3. export const props = defineMixin({
  4. props: {
  5. // #ifdef VUE3
  6. // 用于v-model双向绑定选中的星星数量
  7. modelValue: {
  8. type: [String, Number],
  9. default: () => defProps.rate.value
  10. },
  11. // #endif
  12. // #ifdef VUE2
  13. // 用于v-model双向绑定选中的星星数量
  14. value: {
  15. type: [String, Number],
  16. default: () => defProps.rate.value
  17. },
  18. // #endif
  19. // 要显示的星星数量
  20. count: {
  21. type: [String, Number],
  22. default: () => defProps.rate.count
  23. },
  24. // 是否不可选中
  25. disabled: {
  26. type: Boolean,
  27. default: () => defProps.rate.disabled
  28. },
  29. // 是否只读
  30. readonly: {
  31. type: Boolean,
  32. default: () => defProps.rate.readonly
  33. },
  34. // 星星的大小,单位px
  35. size: {
  36. type: [String, Number],
  37. default: () => defProps.rate.size
  38. },
  39. // 未选中时的颜色
  40. inactiveColor: {
  41. type: String,
  42. default: () => defProps.rate.inactiveColor
  43. },
  44. // 选中的颜色
  45. activeColor: {
  46. type: String,
  47. default: () => defProps.rate.activeColor
  48. },
  49. // 星星之间的间距,单位px
  50. gutter: {
  51. type: [String, Number],
  52. default: () => defProps.rate.gutter
  53. },
  54. // 最少能选择的星星个数
  55. minCount: {
  56. type: [String, Number],
  57. default: () => defProps.rate.minCount
  58. },
  59. // 是否允许半星
  60. allowHalf: {
  61. type: Boolean,
  62. default: () => defProps.rate.allowHalf
  63. },
  64. // 选中时的图标(星星)
  65. activeIcon: {
  66. type: String,
  67. default: () => defProps.rate.activeIcon
  68. },
  69. // 未选中时的图标(星星)
  70. inactiveIcon: {
  71. type: String,
  72. default: () => defProps.rate.inactiveIcon
  73. },
  74. // 是否可以通过滑动手势选择评分
  75. touchable: {
  76. type: Boolean,
  77. default: () => defProps.rate.touchable
  78. }
  79. }
  80. })