mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-15 17:19:11 +08:00
42e2b73cdf
* feat: imageGroup support onChange callback * feat: reset code
19 lines
506 B
TypeScript
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;
|