Socket
Socket
Sign inDemoInstall

img-viewer-react

Package Overview
Dependencies
21
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    img-viewer-react

image viewer for react


Version published
Maintainers
1
Created

Readme

Source

安装

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

Keywords

FAQs

Last updated on 26 Mar 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc