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() {
2626
2727继承 [ View] ( https://facebook.github.io/react-native/docs/view#props ) 组件。
2828
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({
1515const defaultImage = require ( './assets/user.png' ) ;
1616
1717export interface AvatarProps extends ViewProps {
18+ /** React Native `Image` 组件 Props */
1819 imageProps ?: ImageProps ;
20+ /** 图像源(远程URL或本地文件资源)。 */
1921 src ?: string | number ;
22+ /**
23+ * 尺寸
24+ * @default 40
25+ */
2026 size ?: number ;
27+ /**
28+ * 设置圆角
29+ * @default 3
30+ */
2131 rounded ?: number ;
32+ /**
33+ * 指定头像的形状
34+ * @default square
35+ */
2236 shape ?: 'circle' | 'square' ;
2337}
2438
You can’t perform that action at this time.
0 commit comments