-
zhangwei
2025-03-05 16213c0f85aa3ac8317797bf4a05fd12940e16d3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import { AllowedComponentProps, VNodeProps } from './_common'
 
 
declare interface RateProps {
  /**
   * 双向绑定选择星星的数量
   * @default 1
   */
  value?: string | number
  /**
   * 最多可选的星星数量
   * @default 5
   */
  count?: string | number
  /**
   * 是否禁止用户操作
   * @default false
   */
  disabled?: boolean
  /**
   * 是否只读
   * @default false
   */
  readonly?: boolean
  /**
   * 星星的大小,单位rpx
   * @default 18
   */
  size?: string | number
  /**
   * 未选中星星的颜色
   * @default "#b2b2b2"
   */
  inactiveColor?: string
  /**
   * 选中的星星颜色
   * @default "#FA3534"
   */
  activeColor?: string
  /**
   * 星星之间的距离
   * @default 4
   */
  gutter?: string | number
  /**
   * 最少选中星星的个数
   * @default 1
   */
  minCount?: string | number
  /**
   * 是否允许半星选择
   * @default false
   */
  allowHalf?: boolean
  /**
   * 选中时的图标名,只能为uView的内置图标
   * @default "star-fill"
   */
  activeIcon?: string
  /**
   * 未选中时的图标名,只能为uView的内置图标
   * @default "star"
   */
  inactiveIcon?: string
  /**
   * 是否可以通过滑动手势选择评分
   * @default true
   */
  touchable?: boolean
  /**
   * 选中的星星发生变化时触发
   * @param value 当前选中的星星的数量
   */
  onChange?: (value: number) => any
}
 
declare interface _Rate {
  new (): {
    $props: AllowedComponentProps &
      VNodeProps &
      RateProps
  }
}
 
export declare const Rate: _Rate