Skip to content

Commit 4602b2f

Browse files
authored
fix(image): update image props tsType (#3178)
1 parent ea9d0ed commit 4602b2f

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

src/packages/image/doc.en-US.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ The Image component provides lazy loading of images, which can be realized by co
100100
| fit | image fill mode, equivalent to the native object-fit property | `ImageFit` | `fill` |
101101
| position | Image position, equivalent to the original object-position attribute | `ImagePosition` | `center` |
102102
| alt | alternative text | `string` | `-` |
103-
| width | width, default unit `px` | `string` | `-` |
104-
| height | height, default unit `px` | `string` | `-` |
103+
| width | width, default unit `px` | `string \| number` | `-` |
104+
| height | height, default unit `px` | `string \| number` | `-` |
105105
| radius | rounded corner size | `string` \| `number` | `-` |
106106
| error | Whether to display image loading failure | `boolean \| ReactNode` | `true` |
107107
| loading | Whether to show loading images | `boolean \| ReactNode` | `true` |

src/packages/image/doc.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ import { Image } from '@nutui/nutui-react'
100100
| fit | 图片填充模式,等同于原生的 object-fit 属性 | `ImageFit` | `fill` |
101101
| position | 图片位置,等同于原生的 object-position 属性 | `ImagePosition` | `center` |
102102
| alt | 替代文本 | `string` | `-` |
103-
| width | 宽度,默认单位`px` | `string` | `-` |
104-
| height | 高度,默认单位`px` | `string` | `-` |
103+
| width | 宽度,默认单位`px` | `string \| number` | `-` |
104+
| height | 高度,默认单位`px` | `string \| number` | `-` |
105105
| radius | 圆角大小 | `string` \| `number` | `-` |
106106
| error | 是否展示图片加载失败 | `boolean \| ReactNode` | `true` |
107107
| loading | 是否展示加载中图片 | `boolean \| ReactNode` | `true` |

src/packages/image/doc.taro.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ import { Image } from '@nutui/nutui-react-taro'
9191
| 属性 | 说明 | 类型 | 默认值 |
9292
| --- | --- | --- | --- |
9393
| src | 图片链接 | `string` | `-` |
94-
| width | 宽度,默认单位`px` | `string` | `-` |
95-
| height | 高度,默认单位`px` | `string` | `-` |
96-
| radius | 圆角大小 | `string` \| `number` | `-` |
94+
| width | 宽度,默认单位`px` | `string \| number` | `-` |
95+
| height | 高度,默认单位`px` | `string \| number` | `-` |
96+
| radius | 圆角大小 | `string \| number` | `-` |
9797
| error | 是否展示图片加载失败 | `boolean \| ReactNode` | `true` |
9898
| loading | 是否展示加载中图片 | `boolean \| ReactNode` | `true` |
9999
| onLoad | 图片加载完后触发 | `() => void` | `-` |

src/packages/image/doc.zh-TW.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ import { Image } from '@nutui/nutui-react'
100100
| fit | 圖片填充模式,等同於原生的 object-fit 屬性 | `ImageFit` | `fill` |
101101
| position | 圖片位置,等同於原生的 object-position 屬性 | `ImagePosition` | `center` |
102102
| alt | 替代文本 | `string` | `-` |
103-
| width | 寬度,默認單位`px` | `string` | `-` |
104-
| height | 高度,默認單位`px` | `string` | `-` |
103+
| width | 寬度,默認單位`px` | `string \| number` | `-` |
104+
| height | 高度,默認單位`px` | `string \| number` | `-` |
105105
| radius | 圓角大小 | `string` \| `number` | `-` |
106106
| error | 是否展示圖片加載失敗 | `boolean \| ReactNode` | `true` |
107107
| loading | 是否展示加載中圖片 | `boolean \| ReactNode` | `true` |

src/types/spec/image/base.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ export interface BaseImage extends BaseProps {
1313
fit: ImageFit
1414
position: ImagePosition
1515
alt: string
16-
width: string
17-
height: string
16+
width: string | number
17+
height: string | number
1818
radius: SimpleValue
1919
error: ReactNode
2020
loading: ReactNode

0 commit comments

Comments
 (0)