Skip to content

Commit fb0b73d

Browse files
committed
doc(Rating): Update props document. #149
1 parent 498ef9f commit fb0b73d

File tree

3 files changed

+26
-15
lines changed

3 files changed

+26
-15
lines changed

packages/core/src/Rating/README.md

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,27 @@ function Demo() {
4444

4545
## Props
4646

47-
### Rating
48-
49-
| 参数 | 说明 | 类型 | 默认值 |
50-
| --- | --- | --- | --- |
51-
| `defaultRating` | 默认几个 | number | 5 |
52-
| `count` | 总分 | number |5|
53-
| `defaultCount` | 默认分数 | number| 1 count/defaultRating |
54-
| `size` | icon 大小 | number | 24|
55-
| `color` | icon 颜色 | string | `#ebc445`|
56-
| `color` | icon 颜色 | string | `#ebc445`|
57-
| `icon` | 指定显示的图标 | Array<IconsName \| React.ReactElement \| React.ReactNode>: [未选中, 已选中]| [`star-off`,`star-on`]|
58-
| `onPress` | 点击图标的回调 | (score: number) => void type:@param score type: number 得到几分 | |
47+
```ts
48+
import Icon, { IconsName } from '@uiw/react-native';
49+
50+
export type icoType = [IconsName, IconsName] | [React.ReactElement, React.ReactElement] | [React.ReactNode, React.ReactNode]
51+
export interface RatingProps {
52+
/** 默认几个 */
53+
defaultRating?: number,
54+
/** 总分 */
55+
count?: number,
56+
/** 默认分数 */
57+
defaultCount?: number,
58+
/** icon 大小 */
59+
size?: number,
60+
/** icon 颜色 */
61+
color?: string,
62+
/** [未选中, 已选中] */
63+
icon?: icoType,
64+
/**
65+
* void
66+
* @param score type: number 得到几分
67+
*/
68+
onPress?: (score: number) => void
69+
}
70+
```

packages/core/src/Rating/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@ import {
55
Text,
66
TouchableOpacity,
77
} from 'react-native';
8-
// import svgPaths from '@uiw/icons/fonts/w-icon.json';
98

109
import Icon, { IconsName } from '../Icon';
11-
// export type IconsName = keyof typeof svgPaths;
10+
1211
export type icoType = [IconsName, IconsName] | [React.ReactElement, React.ReactElement] | [React.ReactNode, React.ReactNode]
1312
export interface RatingProps {
1413
/** 默认几个 */

packages/core/src/Timeline/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ function Demo() {
3838
}
3939
```
4040

41-
### props
41+
### Props
4242

4343
```ts
4444
export interface TimelineItemsProps {

0 commit comments

Comments
 (0)