Gathering detailed insights and metrics for @idecardo/vue-croppie
Gathering detailed insights and metrics for @idecardo/vue-croppie
Gathering detailed insights and metrics for @idecardo/vue-croppie
Gathering detailed insights and metrics for @idecardo/vue-croppie
npm install @idecardo/vue-croppie
Typescript
Module System
Node Version
NPM Version
Vue (72.6%)
JavaScript (27.4%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
ISC License
1 Commits
1 Forks
1 Watchers
1 Branches
1 Contributors
Updated on Sep 30, 2018
Latest Version
0.1.0
Package Id
@idecardo/vue-croppie@0.1.0
Unpacked Size
180.12 kB
Size
42.04 kB
File Count
10
NPM Version
6.4.1
Node Version
10.10.0
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
A Croppie wrapper for Vue.js 2.
npm install --save @idecardo/vue-croppie
1<template> 2 <div> 3 <croppie ref="croppie" 4 @result="resultEventHandler" 5 @update="updateEventHandler"> 6 </croppie> 7 8 <button @click="bind()">Bind</button> 9 <button @click="destroy()">Destroy</button> 10 <button @click="get()">Get</button> 11 <button @click="init()">Init</button> 12 <button @click="reset()">Reset</button> 13 <button @click="resultEvent()">Result via event</button> 14 <button @click="resultCallback()">Result via callback</button> 15 <button @click="rotate(90)">Rotate</button> 16 <button @click="setZoom(1)">Set Zoom</button> 17 </div> 18</template> 19 20<script> 21 import Croppie from '@idecardo/vue-croppie' 22 23 export default { 24 components: { 25 Croppie, 26 }, 27 data: () => ({ 28 image: 'https://i.imgur.com/ofHthFG.jpg', 29 result: null, 30 }), 31 mounted() { 32 this.$refs.croppie.bind({ 33 url: this.image, 34 }) 35 }, 36 methods: { 37 bind() { 38 this.$refs.croppie.bind({ 39 url: this.image, 40 }) 41 }, 42 destroy() { 43 this.$refs.croppie.destroy() 44 }, 45 get() { 46 this.$refs.croppie.get() 47 }, 48 init() { 49 this.$refs.croppie.init() 50 }, 51 reset() { 52 this.$refs.croppie.reset() 53 }, 54 resultEvent() { 55 this.$refs.croppie.result({ 56 type: 'base64', 57 }) 58 }, 59 resultCallback() { 60 const options = { 61 type: 'base64', 62 format: 'jpeg', 63 } 64 65 this.$refs.croppie.result(options, (result) => { 66 this.result = result 67 }) 68 }, 69 resultEventHandler(result) { 70 this.result = result 71 }, 72 rotate(degrees) { 73 this.$refs.croppie.rotate(degrees) 74 }, 75 setZoom(value) { 76 this.$refs.croppie.setZoom(value) 77 }, 78 updateEventHandler(detail) { 79 console.log(detail) 80 }, 81 }, 82 } 83</script>
All options and methods are as per the Croppie documentation, and can be customized using props.
1<croppie ref="croppie" 2 :enable-orientation="false" 3 :enable-zoom="false" 4 :show-zoomer="false"> 5</croppie>
Name | Usage | Description |
---|---|---|
result | @result="handler" | Triggered when a crop occurs. |
update | @update="handler" | Triggered when a drag or zoom occurs. |
result
event is not available when a callback was passed to the result method.
You can also access methods from the component using Scoped Slots.
In order for croppie to initialize, you must create an element with
data-croppie="container"
attribute anywhere within the default scoped slot.
1<template> 2 <div id="app"> 3 <croppie @result="resultEventHandler" @update="updateEventHandler"> 4 <template slot-scope="{ bind, destroy, get, init, reset, result, rotate, setZoom }"> 5 <!-- Required anywhere within the default scoped slot --> 6 <div data-croppie="container"></div> 7 8 <button @click="bind(bindOptions)">Bind</button> 9 <button @click="destroy()">Destroy</button> 10 <button @click="get(getCallbackHandler)">Get</button> 11 <button @click="init()">Init</button> 12 <button @click="reset()">Reset</button> 13 <button @click="result(resultOptions)">Result via event</button> 14 <button @click="result(resultOptions, resultCallbackHandler)">Result via callback</button> 15 <button @click="rotate(90)">Rotate</button> 16 <button @click="setZoom(1)">Set Zoom</button> 17 </template> 18 </croppie> 19 </div> 20</template> 21 22<script> 23 import Croppie from '@idecardo/vue-croppie' 24 25 export default { 26 components: { 27 Croppie, 28 }, 29 data: () => ({ 30 image: 'https://i.imgur.com/ofHthFG.jpg', 31 result: null, 32 }), 33 methods: { 34 getCallbackHandler(croppie) { 35 console.log(croppie) 36 }, 37 resultCallbackHandler(result) { 38 this.result = result 39 }, 40 resultEventHandler(result) { 41 this.result = result 42 }, 43 updateEventHandler(detail) { 44 console.log(detail) 45 }, 46 }, 47 computed: { 48 bindOptions() { 49 return { 50 url: this.image, 51 } 52 }, 53 resultOptions() { 54 return { 55 type: 'base64', 56 format: 'jpeg', 57 } 58 }, 59 }, 60 } 61</script>
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 0/1 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
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