fengyuanchen / cropperjs

JavaScript image cropper.
https://fengyuanchen.github.io/cropperjs/
MIT License
13.04k stars 2.41k forks source link

With Vue #106

Closed bigZ-again closed 7 years ago

bigZ-again commented 7 years ago

When a crop image embedded in a Vue's el, the getElementById() MUST be behind 'new Vue()', otherwise the cropjs don't working. I have a fall here.

《div id="wrapper"》

《img id="cropImage" src='xxx.jpg'》

《/div》

var image = document.getElementById('cropImage') var vm = new Vue({el: '#wrapper'}) var cropper = new Cropper(image)

fengyuanchen commented 7 years ago

Try this: https://github.com/Agontuk/vue-cropperjs