wk-react-preview
v1.1.7
Published
移动端图片预览,适配Android,IOS, image,photo,view,支持mobile,preview
Downloads
3
Readme
主要用于h5移动端的图片预览 支持Android 和 IOS
使用方法:
npm i -S wk-react-preview
示例:
import { View } from "wk-react-preview";
function Test(){
let arrs = ['http://pic1.win4000.com/wallpaper/9/547fffe6aab65.jpg','http://pic1.win4000.com/wallpaper/9/547fffec90955.jpg','http://pic1.win4000.com/wallpaper/9/547ffff38af56.jpg']
return (
<div>
{
arrs.map(src => {
return <View src={src} style={{width:100,height:100}} />
})
}
</div>
)
}
注:
如果图片不想被预览, 则使用原生的img标签
import { View } from "wk-react-preview";
function Test(){
let arrs = ['http://pic1.win4000.com/wallpaper/9/547fffe6aab65.jpg','http://pic1.win4000.com/wallpaper/9/547fffec90955.jpg','http://pic1.win4000.com/wallpaper/9/547ffff38af56.jpg']
return (
<div>
{
arrs.map((src,index) => {
if(index === 1) {
return <img src={src} style={{width:100,height:100}} />
}
return <View src={src} style={{width:100,height:100}} />
})
}
</div>
)
}
问题反馈: [email protected]