demo: adjust image toolbarRender (#43496)

This commit is contained in:
daisy 2023-07-12 09:43:51 +08:00 committed by GitHub
parent 4f416c64b1
commit 9f509d3be9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 2 deletions

View File

@ -13,6 +13,7 @@ const App: React.FC = () => (
src="https://mdn.alipayobjects.com/huamei_iwk9zp/afts/file/A*uYT7SZwhJnUAAAAAAAAAAAAADgCCAQ"
/>
),
toolbarRender: () => null,
}}
src="https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"
/>

View File

@ -1,10 +1,10 @@
## zh-CN
可以自定义工具栏并添加下载图片按钮。
可以自定义工具栏并添加下载原图或翻转旋转后图片按钮。
## en-US
You can customize the toolbar and add a button for downloading the image.
You can customize the toolbar and add a button for downloading the original image or downloading the flipped and rotated image.
```css
.toolbar-wrapper {

View File

@ -12,6 +12,8 @@ import React from 'react';
const src = 'https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png';
const App: React.FC = () => {
// or you can download flipped and rotated image
// https://codesandbox.io/s/zi-ding-yi-gong-ju-lan-antd-5-7-0-forked-c9jvmp
const onDownload = () => {
fetch(src)
.then((response) => response.blob())