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

picture-preview-vue

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

picture-preview-vue

图片预览功能,兼容移动端单指拖动,双指缩放功能

  • 1.0.6
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
2
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

图片预览功能,兼容移动端单指拖动,双指缩放功能

picture-preview-vue

Demo

Github

Install

npm install --save picture-preview-vue

Usage

import PicturePreviewVue from 'picture-preview-vue'

// 预览单张图片
PicturePreviewVue('https://file.iviewui.com/images/image-demo-2.jpg')


// 预览多张图片
PicturePreviewVue({
  url: 'https://file.iviewui.com/images/image-demo-2.jpg',
  urlList: [
    'https://file.iviewui.com/images/image-demo-1.jpg',
    'https://file.iviewui.com/images/image-demo-2.jpg',
    'https://file.iviewui.com/images/image-demo-3.jpg',
    'https://file.iviewui.com/images/image-demo-4.jpg',
    'https://file.iviewui.com/images/image-demo-5.jpg',
    'https://file.iviewui.com/images/image-demo-6.jpg'
  ] // 当前图片所在列表
})

PicturePreviewVue 方法接收一个参数,字符串或对象:

  • 字符串,必须传入一个 url 地址;
  • 对象,url 传入当前图片地址,urlList 传入当前图片所在列表数据。

预览时,可以使用键盘 ←、→ 切换图片,↑、↓ 缩放图片,Space 显示 1:1 图片,ESC 退出预览。

使用示例

FAQs

Package last updated on 25 Mar 2024

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