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.10
  • npm
  • Socket score

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

pic-viewer / 图片预览

before preview


previewing

Features

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

Installation

NPM

$ yarn add pic-viewer

Dependencies:vue

import PicViewer from 'pic-viewer'

// 组件内引入
components: { PicViewer }

// 全局引入
Vue.use(PicViewer)

Quick Start

Waterfall Layout:

<PicViewer :value=""/>

Normal Flow Layout:

Typically used in tables

Here's an example for element-ui:

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

Preview manually, no external display:

<PicViewer :value="" v-show="false" ref="PicViewer"/>
<button @click="() => { $refs.PicViewer.preview(6) }">preview</button>
AttributeDescriptionTypeOptionsDefault
valueimg link[s]string / array[string] / array[object]
objectKeyif type of value is array[object], you need to specify the img key of objectstring
waterfallwhether using waterfall layoutbooleantrue

MethodDescriptionParameters
previewpreview manuallyindex of value array (default: 0)

Keywords

FAQs

Package last updated on 25 Jan 2021

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