Skip to content

Commit

Permalink
docs: image component adding destroyOnClose (#48827)
Browse files Browse the repository at this point in the history
* docs: image component adding destroyOnClose

* docs: update demo
  • Loading branch information
wanpan11 committed May 8, 2024
1 parent 4384984 commit e2d7e68
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions components/image/demo/imageRender.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const App: React.FC = () => (
<Image
width={200}
preview={{
destroyOnClose: true,
imageRender: () => (
<video
muted
Expand Down
1 change: 1 addition & 0 deletions components/image/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ Other attributes [&lt;img>](https://developer.mozilla.org/en-US/docs/Web/HTML/El
| forceRender | Force render preview dialog | boolean | - | - |
| toolbarRender | Custom toolbar render | (originalNode: React.ReactElement, info: Omit<[ToolbarRenderInfoType](#toolbarrenderinfotype), 'current' \| 'total'>) => React.ReactNode | - | 5.7.0 |
| imageRender | Custom preview content | (originalNode: React.ReactElement, info: { transform: [TransformType](#transformtype) }) => React.ReactNode | - | 5.7.0 |
| destroyOnClose | Destroy child elements when closing preview | boolean | false | |
| onTransform | Callback when the transform of image changed | { transform: [TransformType](#transformtype), action: [TransformAction](#transformaction) } | - | 5.7.0 |
| onVisibleChange | Callback when `visible` changed | (visible: boolean, prevVisible: boolean) => void | - | - |

Expand Down
1 change: 1 addition & 0 deletions components/image/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ coverDark: https://mdn.alipayobjects.com/huamei_7uahnr/afts/img/A*LVQ3R5JjjJEAAA
| forceRender | 强制渲染预览图 | boolean | - | - |
| toolbarRender | 自定义工具栏 | (originalNode: React.ReactElement, info: Omit<[ToolbarRenderInfoType](#toolbarrenderinfotype), 'current' \| 'total'>) => React.ReactNode | - | 5.7.0 |
| imageRender | 自定义预览内容 | (originalNode: React.ReactElement, info: { transform: [TransformType](#transformtype) }) => React.ReactNode | - | 5.7.0 |
| destroyOnClose | 关闭预览时销毁子元素 | boolean | false | |
| onTransform | 预览图 transform 变化的回调 | { transform: [TransformType](#transformtype), action: [TransformAction](#transformaction) } | - | 5.7.0 |
| onVisibleChange |`visible` 发生改变时的回调 | (visible: boolean, prevVisible: boolean) => void | - | - |

Expand Down

0 comments on commit e2d7e68

Please sign in to comment.