mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 03:59:01 +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;
|