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.
 
 
 

84 rivejä
2.4 KiB

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