pespantelis / vue-crop Goto Github PK
View Code? Open in Web Editor NEW:left_right_arrow: Crop directive for Vue.js
Home Page: http://pespantelis.github.io/vue-crop
License: MIT License
:left_right_arrow: Crop directive for Vue.js
Home Page: http://pespantelis.github.io/vue-crop
License: MIT License
I need to crop two images in different places on the same page. How can I call VueCrop more than once on the same page?
Any plans to update this plugin to Vue 2?
Hi guys, this is great work !
It would be pretty cool if we could manage vue-crop with npm, so we can stay up to date and make things easier, you know ?
Hey,
Thanks for creating this.
Im trying to make this work with Vue version 1
Im getting the following issues:
Invalid v-crop event: null
app.js:18955 [Vue warn]: Invalid expression. Generated function body: scope.start:scope.cropping
app.js:18961 Error: Warning Stack Trace
at warn (app.js:18961)
at makeGetterFn (app.js:20842)
at compileGetter (app.js:20825)
at parseExpression (app.js:20887)
at Directive._checkStatement (app.js:25790)
at Directive._bind (app.js:25683)
at linkAndCapture (app.js:24385)
at compositeLinkFn (app.js:24363)
at new Fragment (app.js:22390)
at FragmentFactory.create (app.js:22592)
app.js:28202 Uncaught TypeError: Cannot read property 'container' of undefinedupdate @ app.js:28202Directive._checkStatement @ app.js:25800Directive._bind @ app.js:25683linkAndCapture @ app.js:24385compositeLinkFn @ app.js:24363Fragment @ app.js:22390FragmentFactory.create @ app.js:22592create @ app.js:22861diff @ app.js:22774update @ app.js:22709Directive._bind @ app.js:25712linkAndCapture @ app.js:24385compositeLinkFn @ app.js:24363Fragment @ app.js:22390FragmentFactory.create @ app.js:22592insert @ app.js:22634update @ app.js:22622_update @ app.js:25689Watcher.run @ app.js:21230runBatcherQueue @ app.js:20971flushBatcherQueue @ app.js:20945nextTickHandler @ app.js:18415
app.js:21199 Uncaught Error: [vue] async stack trace
I have the directive installed globally like so..
import vueCrop from 'vue-crop'
Vue.directive('crop', vueCrop)
And referencing jCrop and jQuery:
<link rel="stylesheet" href="http://jcrop-cdn.tapmodo.com/v2.0.0-RC1/css/Jcrop.css" type="text/css">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="http://jcrop-cdn.tapmodo.com/v2.0.0-RC1/js/Jcrop.js"></script>
I'm then applying the directive to an image tag:
<img src="../../../assets/images/staff/thurner.jpg"
width="600" height="400"
v-crop:create="crop" v-crop:start="crop" v-crop:move="crop" v-crop:end="crop" />
And setup a method to listen for the events:
crop: function (event, selection, coordinates) {
console.log(event)
this.coords = coordinates
},
But the events never seem to fire and no cropping box or handles appear on the image. What am I missing?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.