File tree Expand file tree Collapse file tree 2 files changed +39
-7
lines changed Expand file tree Collapse file tree 2 files changed +39
-7
lines changed Original file line number Diff line number Diff line change @@ -26,10 +26,28 @@ function Demo() {
26
26
27
27
继承 [ View] ( https://facebook.github.io/react-native/docs/view#props ) 组件。
28
28
29
- | 参数 | 说明 | 类型 | 默认值 |
30
- | ------| ------| -----| ------|
31
- | ` src ` | 图像源(远程URL或本地文件资源)。 | String/Number | - |
32
- | ` imageProps ` | React Native ` Image ` 组件 Props | ImageProps | - |
33
- | ` size ` | 设置圆角 | Number | ` 40 ` |
34
- | ` rounded ` | 设置圆角 | Number | ` 3 ` |
35
- | ` shape ` | 指定头像的形状 ` square ` 正方形或者 ` circle ` 圆 | ` circle ` /` square ` | ` square ` |
29
+ ``` ts
30
+ import { ViewProps } from ' react-native' ;
31
+
32
+ export interface AvatarProps extends ViewProps {
33
+ /** React Native `Image` 组件 Props */
34
+ imageProps? : ImageProps ;
35
+ /** 图像源(远程URL或本地文件资源)。 */
36
+ src? : string | number ;
37
+ /**
38
+ * 尺寸
39
+ * @default 40
40
+ */
41
+ size? : number ;
42
+ /**
43
+ * 设置圆角
44
+ * @default 3
45
+ */
46
+ rounded? : number ;
47
+ /**
48
+ * 指定头像的形状
49
+ * @default square
50
+ */
51
+ shape? : ' circle' | ' square' ;
52
+ }
53
+ ```
Original file line number Diff line number Diff line change @@ -15,10 +15,24 @@ const styles = StyleSheet.create({
15
15
const defaultImage = require ( './assets/user.png' ) ;
16
16
17
17
export interface AvatarProps extends ViewProps {
18
+ /** React Native `Image` 组件 Props */
18
19
imageProps ?: ImageProps ;
20
+ /** 图像源(远程URL或本地文件资源)。 */
19
21
src ?: string | number ;
22
+ /**
23
+ * 尺寸
24
+ * @default 40
25
+ */
20
26
size ?: number ;
27
+ /**
28
+ * 设置圆角
29
+ * @default 3
30
+ */
21
31
rounded ?: number ;
32
+ /**
33
+ * 指定头像的形状
34
+ * @default square
35
+ */
22
36
shape ?: 'circle' | 'square' ;
23
37
}
24
38
You can’t perform that action at this time.
0 commit comments