wk-react-preview

1.1.7 • Public • Published

主要用于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>
  )
}

问题反馈: 443028159@qq.com

Readme

Keywords

none

Package Sidebar

Install

npm i wk-react-preview

Weekly Downloads

0

Version

1.1.7

License

ISC

Unpacked Size

48.7 kB

Total Files

3

Last publish

Collaborators

  • a443028159