react实现图片的放大、缩小、旋转及移动功能组件
使用 React+typescript 的组件库
react实现图片的放大、缩小、旋转及移动功能组件
npm install react-image-zoom --save 使用
// 引入组件 import { ImgZoom } from 'react-image-zoom' // 代码示例 <ImgZoom dataSource={{ url: 'static/media/example.e6118d8b.png' }} /> ImgZoom Component
property | propType | required | default | description |
---|---|---|---|---|
dataSource | object | yes | { url: '', scale: 1, rotate: 0, translateX: 0, translateY: 0 } | 设置 数据源 |
className | string | - | - | 设置 容器的className |
showOpt | bool | - | true | 是否显示操作按钮 |
版权声明:
1、该文章(资料)来源于互联网公开信息,我方只是对该内容做点评,所分享的下载地址为原作者公开地址。2、网站不提供资料下载,如需下载请到原作者页面进行下载。