How to realize the function of cropping pictures with cropperjs
Most people do not understand the knowledge points of this article "cropperjs how to achieve the function of cropping pictures", so the editor summarizes the following contents, detailed contents, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "how to achieve cropping pictures in cropperjs" article.
Cropperjs (crop Picture)
Vue version
/ / download / / npm install cropperjs-save// uses / / 1.0 to introduce import Cropper from 'cropperjs'// 2.0 initialization cropping box data () {return {croppable: false / / Control upload explicit}}, methods: {var _ this= this; var image = document.getElementById (' image') This.cropper = new Cropper (image, {aspectRatio: 1, viewMode: 1, background:false, zoomable:false, ready: function () {_ this.croppable = true;}});}
Jq version
Select Picture
Select Picture