Skip to content

Commit

Permalink
docs: rate upate
Browse files Browse the repository at this point in the history
  • Loading branch information
MrXiangXvFan authored Oct 9, 2024
1 parent d5aa3e5 commit e745379
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/vantui/src/rate/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ export function Rate(props: RateProps) {
gutter,
icon = 'star',
voidIcon = 'star-o',
disabled,
disabled = false,
size,
disabledColor,
color,
voidColor,
allowHalf,
readonly,
readonly = false,
touchable = true,
value,
onChange,
Expand Down
25 changes: 23 additions & 2 deletions packages/vantui/types/rate.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,46 @@ import { FunctionComponent } from 'react'
import { ViewProps, ITouchEvent } from '@tarojs/components'

export interface RateProps extends ViewProps {
/**
* @description 当前分值
*/
value?: number
/**
* @description 默认值
* @description 默认分值
*/
defaultValue?: number
/**
* @description 是否只可读
* @default false
*/
readonly?: boolean
/**
* @description 是否禁用
* @default false
*/
disabled?: boolean
/**
* @description 是否允许选择一般
* @description 是否允许半选
* @default false
*/
allowHalf?: boolean
/**
* @description 图标大小,默认单位为px
*/
size?: string | number
/**
* @description 自定义图标的classPrefix
* @default van-icon
*/
iconClassPrefix?: string
/**
* @description 选中图标
* @default star
*/
icon?: string
/**
* @description 未选中图标
* @default star-o
*/
voidIcon?: string
/**
Expand All @@ -42,17 +54,26 @@ export interface RateProps extends ViewProps {
voidColor?: string
/**
* @description 禁用颜色
* @default #c8c9cc
*/
disabledColor?: string
/**
* @description 总体数量
* @default 5
*/
count?: number
/**
* @description 图标间距,默认单位为 px
*/
gutter?: string | number
/**
* @description 是否可以通过滑动手势选择评分
* @default true
*/
touchable?: boolean
/**
* @description 当前分值变化时触发的事件
*/
onChange?: (e: ITouchEvent) => any
}

Expand Down

0 comments on commit e745379

Please sign in to comment.