<div><img src="./default.png" alt="" /></div>
<div><img src="./girl3.jpeg" alt="" /></div>
<div><img src="./girl4.png" alt="" /></div>
<script src="./node_modules/touch-dom-zoom/lib/umd.js"></script>
<script>
window.onload = function () {
const doms = document.querySelectorAll('div')
zoomDom(doms)
}
</script>
import zoomDom from 'touch-dom-zoom'
async
componentDidMount()
{
const { data } = await fetch('......').json()
this.setState({ dataSource: data }, () => {
zoomDom(document.querySelectorAll('.item'))
})
}
render()
{
const { dataSource } = this.state
return (
<div>
{dataSource.map((item) => {
return (
<div className={'item'}>
<img />
.....
</div>
)
})}
</div>
)
}