Gathering detailed insights and metrics for vue-modern-cropper
Gathering detailed insights and metrics for vue-modern-cropper
Gathering detailed insights and metrics for vue-modern-cropper
Gathering detailed insights and metrics for vue-modern-cropper
npm install vue-modern-cropper
Typescript
Module System
Node Version
NPM Version
69.6
Supply Chain
90.4
Quality
83.3
Maintenance
100
Vulnerability
100
License
Vue (58.71%)
TypeScript (37.19%)
JavaScript (4.1%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
2,201
Last Day
5
Last Week
9
Last Month
55
Last Year
2,201
MIT License
4 Stars
80 Commits
1 Watchers
1 Branches
1 Contributors
Updated on Aug 24, 2024
Minified
Minified + Gzipped
Latest Version
0.2.12
Package Id
vue-modern-cropper@0.2.12
Unpacked Size
13.02 kB
Size
4.94 kB
File Count
7
NPM Version
10.7.0
Node Version
20.15.0
Published on
Aug 24, 2024
Cumulative downloads
Total Downloads
Last Day
25%
5
Compared to previous day
Last Week
-60.9%
9
Compared to previous week
Last Month
-62.3%
55
Compared to previous month
Last Year
0%
2,201
Compared to previous year
Power-packed wrapper over cropperjs@next
vue-modern-cropper
uses cropperjs@next
(v2), which is not yet stable release, you can check it's documentation HERE
As it current state, cropperjs
is not SSR-friendly, though even if it's SSR-able, I think it would be better to render it client-only to avoid overhead on the server, so remember it wrap/mark the component as ClientOnly
if your project have SSR-enabled.
Feel free to submit PRs to add helper functions 😘.
1pnpm add vue-modern-cropper
1// Register it globally 2import { ModernCropper } from 'vue-modern-cropper' 3Vue.component(ModernCropper) 4 5/* SomeComponent.vue */ 6// Or you could import it locally 7import { ModernCropper } from 'vue-modern-cropper' 8 9// Use InstanceType to infer the exposed props 10const cropper = ref<InstanceType<typeof ModernCropper>>() 11 12onMounted(async () => { 13 // remember to await nextTick if you use Nuxt (Nuxt client component caveat) 14 await nextTick() 15 16 // Use onCropperMounted to execute hooks as soon as the cropper APIs is available 17 cropper.value!.onCropperMounted(({ cropper, image, canvas, selection, selections }) => { 18 selection.$toCanvas().then(canvas => console.log('cropped:', canvas.toDataURL())) 19 }) 20 21 // Or access them directly through the ref, you need to make sure they are available though 22 if (cropper.value.cropperMounted) 23 cropper.value.cropper 24}) 25... 26<ModernCropper 27 ref="cropper" 28 class="w-80 h-40" 29 :src="imgSrc" 30 :pass-through="{ 31 cropper: { constructOptions: undefined }, 32 image: { attributes: { class: 'blur' } }, 33 canvas: { attributes: { background: false } }, 34 selection: { attributes: undefined }, 35 selections: { attributes: undefined }, 36 }" 37/> 38... 39
MIT @NamesMT
No vulnerabilities found.
No security vulnerabilities found.