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

images-viewer-vue3

Package Overview
Dependencies
Maintainers
0
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

images-viewer-vue3

images-viewer-vue3 是一款Vue3专属轻量级图片查看器

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
25
decreased by-78.45%
Maintainers
0
Weekly downloads
 
Created
Source

images-viewer-vue3

A lightweight image viewer for Vue3, it is based on flip animation technology, currently only supports PC.

Features
  • Component preview image
  • Command preview image
  • API preview image

Install

npm install images-viewer-vue3
--or
pnpm install images-viewer-vue3
--or
yarn add images-viewer-vue3
Usage
Component preview image

The component wraps the image element, click directly to preview.

// main.ts
import { createApp } from "vue";
import App from "./App.vue";
import ImagesViewerVue3 from 'images-viewer-vue3';

const app = createApp(App)
// Image preview directive will be automatically injected here
app.use(ImagesViewerVue3)
app.mount("#app")

// demo.vue
<ImagesViewerVue3>
    <img src="https://picsum.photos/id/6/5000/3333"/>
    <img src="https://picsum.photos/id/10/2500/1667"/>
    <img src="https://picsum.photos/id/11/2500/1667"/>
</ImagesViewerVue3>
Command preview image

Add v-image-viewer to the image tag that needs to be previewed. All imgs with added instructions will be automatically added to the preview list.

<img v-image-viewer src="https://picsum.photos/id/19/2500/1667"/>
<img v-image-viewer src="https://picsum.photos/id/63/2500/1667"/>
API preview image
<img @click="preview" src="https://picsum.photos/id/19/2500/1667"/>

import { imageViewerApi } from 'images-viewer-vue3'

const open = (evt) => {
    imageViewerApi({
        current: evt.target.src,
        // Enable flip animation
        imageDom: evt.target,
        // Picture preview collection
        // images: ['src', ...],
    })
}

Keywords

FAQs

Package last updated on 15 Oct 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