GithubHelp home page GithubHelp logo

pespantelis / vue-crop Goto Github PK

View Code? Open in Web Editor NEW
274.0 274.0 19.0 190 KB

:left_right_arrow: Crop directive for Vue.js

Home Page: http://pespantelis.github.io/vue-crop

License: MIT License

JavaScript 100.00%

vue-crop's People

Contributors

pespantelis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

vue-crop's Issues

Vue 2.0

Any plans to update this plugin to Vue 2?

Use of NPM ?

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 ?

Issues with v1

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

No select box and resize handles showing or crop events triggering

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.