1.0.4 • Published 1 month ago

img-viewer-react v1.0.4

Weekly downloads
-
License
ISC
Repository
-
Last release
1 month ago

安装

image viewer for react

npm install img-viewer-react

引入

在页面中中引入

import {ImgViewer} from "img-viewer-react"
import "@/node_modules/img-viewer-react/style.css"; //引入组件样式

在页面中使用

function App () {
  let ImgList = [] // 图片链接
  const fullTool = [
    {
      icon: '', // 使用在线连接
      func: otherFunc
    }
  ]
  function otherFunc () {
    console.log('this is other method');
  }
  const toolInfo = {
    layout: 'v', // 布局 h/v
    fullTool: fullTool,
    layoutChange: true, // 是否可以更改布局
    clickFunc: seeImg, // 图片的点击事
  }
  function seeImg (src) {
    // console.log(src);
  }
  return(
    <>
      <ImgViewer ImgList={ImgList} toolInfo={toolInfo}/>
    </>
  )
}
export default App
1.0.4

1 month ago

1.0.3

2 months ago

1.0.2

2 months ago

1.0.1

2 months ago

1.0.0

2 months ago