
Security News
Open Source CAI Framework Handles Pen Testing Tasks up to 3,600× Faster Than Humans
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
images-viewer-vue3
Advanced tools
A lightweight image viewer for Vue3, it is based on flip animation
technology, Support PC and h5 mobile web page preview photos, if it is a product developed by vue3.
images-viewer-vue3 demo(https://github.com/qiunanya/vue3-major-editor/tree/main/packages/image-viewer)
npm install images-viewer-vue3
--or
pnpm install images-viewer-vue3
--or
yarn add images-viewer-vue3
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, {
zIndex: 999, // Default 999
language: 'zh', // Default language 'zh'
scaleRatio: 1, // Default 1
rotateRatio: 90, // Default 90 degrees
isEnableDrag: true, // Enabled by default
isEnableWheel: true, // Enabled by default
})
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>
Initialize the configuration in app.use(ImagesViewerVue3,options)
of the main.ts
file.
Option | Allowed Value | Default | Description |
---|---|---|---|
scaleRatio | number in percentage | 1 | It defines the initial zoom value of the image. |
zIndex | number in percentage | 999 | Initial value of the previewer stacking order property. |
rotateRatio | number in percentage | 90 | It defines the initial value of the image rotation angle. |
isEnableDrag | boolean | true | Defines whether to enable the drag and drop function. |
isEnableWheel | boolean | true | Defines whether to enable mouse scrolling to zoom the image. |
language | 'zh' or 'en' | 'zh' | Define the prompt text display language. |
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"/>
<img @click="previewImage" src="https://picsum.photos/id/19/2500/1667"/>
<script setup lang="ts">
import { imageViewerApi } from 'images-viewer-vue3'
const previewImage = (evt) => {
if (!evt.target) return
const iDom = evt.target as HTMLImageElement
imageViewerApi({
current: iDom.src,
// Enable flip animation
imageDom: iDom,
// Preview more pictures
// images: ['src', ...],
})
}
</script>
The images-viewer-vue3
has built-in commonly used shortcut keys.
Shortcut Key | Function Description |
---|---|
Right(→) | Next |
Left(←) | Previous |
Ctrl+Right(→) | Next Page |
Ctrl+Left(←) | Previous page |
Ctrl+I+Y | Flip Vertically |
Ctrl+I+X | Flip Horizontal |
Ctrl+C+R | Rotate 90 degrees clockwise |
Ctrl+C+L | Rotate 90 degrees counterclockwise |
Ctrl+Z | Restore initial value |
Ctrl+'+' | Zoom |
Ctrl+'-' | Zoom out |
ESC | Close Preview |
FAQs
A lightweight image viewer for Vue3
The npm package images-viewer-vue3 receives a total of 31 weekly downloads. As such, images-viewer-vue3 popularity was classified as not popular.
We found that images-viewer-vue3 demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.