Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pic-viewer

Package Overview
Dependencies
Maintainers
1
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pic-viewer

开箱即用、支持表格嵌套的图片预览器

  • 0.2.7
  • npm
  • Socket score

Version published
Weekly downloads
10
increased by42.86%
Maintainers
1
Weekly downloads
 
Created
Source

pic-viewer / 图片预览

预览前 / before preview

预览前

预览时 / previewing

预览时

Feature

  • √ viewerjs的vue版本 增加了预览前的外部展示 使其开箱即用
  • √ 支持自适应瀑布流展示、嵌套在表格内展示
  • √ 灵活的数据类型:支持字符串/字符串数组/对象数组
  • √ 友好的hover交互
  • √ 支持全局安装/单独引入

Installation

NPM

$ yarn add pic-viewer

依赖项:vue


全局引入

import PicViewer from 'pic-viewer'
Vue.use(PicViewer)

局部引入

import { PicViewer } from 'pic-viewer'
components: { PicViewer }

Quick Start

自适应瀑布流布局

<PicViewer :value=""/>

文档流布局

典型应用场景:表格

<el-table>
  <el-table-column label="图片">
    <template slot-scope="{ row }">
      <PicViewer :waterfall="false" :value="row.img"/>
    </template>
  </el-table-column>
</el-table>

手动调用预览 不在外部陈列展示

<PicViewer :value="" v-show="false" ref="PicViewer"/>
<el-button @click="()=>{$refs.PicViewer.preview(6)}">预览</el-button>
参数说明类型可选值默认值
value图片链接String / Array[String] / Array[Object]
objectKey如果数组元素为对象 需要指定图片对应的keyString
waterfall是否瀑布流布局Booleantrue
方法名说明参数
preview手动预览value数组下标(value类型为Array时需要 默认0)

Keywords

FAQs

Package last updated on 20 Aug 2020

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc