Gathering detailed insights and metrics for v-image
Gathering detailed insights and metrics for v-image
Gathering detailed insights and metrics for v-image
Gathering detailed insights and metrics for v-image
v-viewer
Image viewer component for vue, supports rotation, scale, zoom and so on, based on viewer.js
@uni/image
[](https://www.npmjs.com/package/@uni/apis) [](https://www.npmjs.com/package/@uni/image)
v-lazy-image
[](https://www.npmjs.com/package/v-lazy-image) [](https://www.npmjs.com/package/v-lazy-image) [
npm install v-image
Typescript
Module System
Min. Node Version
Node Version
NPM Version
Vue (56.43%)
JavaScript (18.54%)
TypeScript (17.32%)
CSS (5.06%)
HTML (2.66%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
40 Stars
3,285 Commits
4 Forks
2 Watchers
12 Branches
2 Contributors
Updated on Jun 01, 2025
Latest Version
3.1.2
Package Id
v-image@3.1.2
Unpacked Size
45.62 kB
Size
10.58 kB
File Count
12
NPM Version
10.2.4
Node Version
18.19.1
Published on
Mar 21, 2024
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
28
⚠️ Docs are for Vue 3, for Vue 2 docs, check this tree
1npm i v-image
1# install dependencies 2$ npm install 3 4# package lib 5$ npm run build
Global component:
1// main.ts 2import { VImage } from 'v-image'; 3import { createApp } from 'vue'; 4 5const app = createApp({}); 6app.component('VImage', VImage);
Or use locally
1// component.vue 2<script lang="ts"> 3import { VImage } from 'v-image'; 4 5export default defineComponent({ 6 components: { 7 VImage, 8 }, 9}) 10</script>
For Nuxt 3, create a file in plugins/v-image.ts
1import { VImage } from 'v-image'; 2 3export default defineNuxtPlugin((nuxtApp) => { 4 nuxtApp.vueApp.component('VImage', VImage); 5});
then import the file in nuxt.config.{j|t}s
:
1export default { 2 // ... 3 plugins: [ 4 // ... 5 { src: '~/plugins/v-image', mode: 'client' }, 6 // ... 7 ], 8 // ... 9};
1<template> 2 <v-image 3 wrapper="flex justify-center items-center content-center w-full h-full" 4 :placeholder="placeholder" 5 :form="form" 6 :uploaded="uploaded" 7 @image-loaded="onImageLoad" 8 @image-removed="onImageRemove" 9 /> 10</template>
1<script lang="ts"> 2 import { defineComponent, ref } from 'vue'; 3 import type { Ref } from 'vue'; 4 import { VImage } from 'v-image'; 5 6 export default defineComponent({ 7 components: { VImage }, 8 setup() { 9 const image: Ref<null | string> = ref(null); 10 const placeholder = ref({ 11 image: 'https://picsum.photos/1000/1000', 12 alt: 'Placeholder Image', 13 imgClass: 'block rounded object-contain min-h-0 w-72', 14 btnClass: 15 'cursor-pointer inline-flex items-center justify-center mt-4 rounded-md border border-transparent bg-indigo-600 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 w-72', 16 wrapper: 'p-4 max-w-xs w-full border border-gray-400 border-dotted', 17 }); 18 const form = ref({ 19 name: 'myImage', 20 label: 'Select Image', 21 accept: 'image/jpg', 22 }); 23 const uploaded = ref({ 24 wrapper: 'p-4 max-w-xs w-full border border-gray-400 border-dotted', 25 alt: 'User uploaded dope image', 26 imgClass: 'block rounded object-contain min-h-0 w-72', 27 btnClass: 28 'cursor-pointer inline-flex items-center justify-center mt-4 rounded-md border border-transparent bg-indigo-600 px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2 w-72', 29 removeBtnText: 'Remove image', 30 }); 31 32 const onImageLoad = (img: string) => { 33 image.value = img; 34 }; 35 const onImageRemove = (deleted: boolean) => { 36 if (deleted) { 37 image.value = null; 38 } 39 }; 40 41 return { 42 placeholder, 43 form, 44 uploaded, 45 onImageLoad, 46 onImageRemove, 47 }; 48 }, 49 }); 50</script>
Name | Type | Required? | Default | Description |
---|---|---|---|---|
wrapper | String | No | '' | The wrapper classes for the top level <div> |
placeholder | Object | No | - | The placeholder image & input related code |
placeholder.wrapper | String | No | '' | Any wrapper classes for the placeholder <div> |
placeholder.image | String | No | 'https://picsum.photos/200x200' | The placeholder image |
placeholder.alt | String | No | 'Placeholder Image' | The placeholder image alt attribute |
placeholder.imgClass | String | No | '' | Any placeholder image classes |
placeholder.btnClass | String | No | '' | Select Image button classes |
form | Object | No | - | The placeholder input form |
form.name | String | No | 'v-image' | Enable the label to interact with the <input /> |
form.label | String | No | 'Select Image' | The label/button text |
form.accept | String | No | 'image/*' | Abilty to accept file types |
uploaded | Object | No | - | The user uploaded image related Object |
uploaded.wrapper | String | No | '' | Any wrapper classes for the uploaded image <div> |
uploaded.alt | String | No | 'Very Interesting Image' | The actual uploaded image alt attribute |
uploaded.imgClass | String | No | '' | Uploaded image classes |
uploaded.btnClass | String | No | '' | Remove Image button classes |
uploaded.removeBtnText | String | No | 'Remove Image' | Remove Image button text |
Name | Returns | Description |
---|---|---|
@image-loaded | String | Sends the image in base64 format |
@image-removed | Boolean | Emits true if image is removed |
git checkout -b feat/new-feature
)git commit -Sam 'feat: add feature'
)git push origin feat/new-feature
)Note:
v-image © Vinayak, Released under the MIT License.
Authored and maintained by Vinayak Kulkarni with help from contributors (list).
vinayakkulkarni.dev · GitHub @vinayakkulkarni · Twitter @_vinayak_k
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
SAST tool is run on all commits
Details
Reason
4 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 3
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
project is not fuzzed
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More