Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/systemlight/react-wb-imageviewer

:clapper: Images viewer is a react component use in mobile website App, that function same as Weibo native viewer.【移动端图片放大查看器】
https://github.com/systemlight/react-wb-imageviewer

images javascript react viewer weibo

Last synced: 2 days ago
JSON representation

:clapper: Images viewer is a react component use in mobile website App, that function same as Weibo native viewer.【移动端图片放大查看器】

Awesome Lists containing this project

README

        

# react-wb-imageviewer

[![NPM version](https://img.shields.io/npm/v/react-wb-imageviewer.svg)](https://www.npmjs.com/package/react-wb-imageviewer)

> 基于react的一个超级简易的移动端图片查看器。

### 安装

```
npm i react-wb-imageviewer
```

### 使用举例

```

function App() {
let [open, setOpen] = React.useState(false)

return (
<div>
<button onClick={() => {
setOpen(true)
}}>打开图片
</button>

<WbImageViewer visibility={open}
src={'https://t7.baidu.com/it/u=2291349828,4144427007&fm=193&f=GIF'}
onClose={() => {
setOpen(false)
}} />
</div>
)
}

ReactDOM.createRoot(
document.querySelector('#app')
).render(<App />)

```