Socket
Socket
Sign inDemoInstall

@luohc92/vue3-image-viewer

Package Overview
Dependencies
21
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @luohc92/vue3-image-viewer

a image viewer for vue3.0 一款vue3.0的图片查看器


Version published
Weekly downloads
2
decreased by-60%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

vue3-image-viewer

A image viewer for vue3.x

一款vue3.0的图片查看器

vue2.x版 vue-image-viewer

Install 安装

npm install @luohc92/vue3-image-viewer

Usage 使用方法

import ImageViewer from "@luohc92/vue3-image-viewer";
import '@luohc92/vue3-image-viewer/dist/style.css';
  ImageViewer({
    images: images,
    curIndex: 0,
    zIndex: 2000,
    showDownload: true,
    showThumbnail: true,
    handlePosition: "bottom",
    maskBgColor: "rgba(0,0,0,0.7)",
    onClose: () => {
      console.log("close");
    },
  });

Props 属性

NameTypeRequiredDescriptionDefault
imagesArraytrueimages source 图片源[]
curIndexNumberfalsedefault display image 默认显示图片0
zIndexNumberfalseset image viewer z-index 设置图片查看器的 z-index2000
showDownloadBooleanfalseshow download button 显示下载按钮false
showThumbnailBooleanfalseshow images thumbnail 显示图片缩略图false
handlePositionString [top,bottom]falseset handle position 设置操作柄显示位置bottom
maskBgColorStringfalseset mask background color 设置遮罩背景颜色rgba(0,0,0,0.7)
onCloseFunctionfalseclose function callback 关闭方法回调null
onDownloadFunctionfalsedownload image function callback 关闭方法回调null

Keyboard Shortcuts 快捷键

KeyboardAction
arrow-leftprev 上一张
arrow-rightnext 下一张
arrow-upzoomIn 放大
arrow-downzoomOut 缩小
altclockwise rotation 顺时针旋转
ctrlmirror 镜像翻转
spacetoggle image size mode [contain,original] 图片显示大小模式[自适应大小,原始大小]
escclose 关闭

FAQs

Last updated on 20 Oct 2022

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc