ant-design/components/image/demo/preview-group.tsx
kiner-tang(文辉) 42e2b73cdf
feat(image): Image.PreviewGroup support preview.onChange callback (#40857)
* feat: imageGroup support onChange callback

* feat: reset code
2023-02-21 21:21:51 +08:00

19 lines
506 B
TypeScript

import React from 'react';
import { Image } from 'antd';
const App: React.FC = () => (
<Image.PreviewGroup
preview={{
onChange: (current, prev) => console.log(`current index: ${current}, prev index: ${prev}`),
}}
>
<Image width={200} src="https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg" />
<Image
width={200}
src="https://gw.alipayobjects.com/zos/antfincdn/aPkFc8Sj7n/method-draw-image.svg"
/>
</Image.PreviewGroup>
);
export default App;