Browse Source

demo: adjust image toolbarRender (#43496)

pull/43498/head
daisy 1 year ago
committed by GitHub
parent
commit
9f509d3be9
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      components/image/demo/imageRender.tsx
  2. 4
      components/image/demo/toolbarRender.md
  3. 2
      components/image/demo/toolbarRender.tsx

1
components/image/demo/imageRender.tsx

@ -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"
/>

4
components/image/demo/toolbarRender.md

@ -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 {

2
components/image/demo/toolbarRender.tsx

@ -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())

Loading…
Cancel
Save