Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue-cropper

Package Overview
Dependencies
Maintainers
1
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-cropper

A simple Vue picture clipping plugin

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
17K
decreased by-3.44%
Maintainers
1
Weekly downloads
 
Created
Source

vue-crpopper

preview
中文

vue-cropper

install
npm install vue-cropper
use
import VueCropper from vue-cropper
<vueCropper
  ref="cropper"
  :img="option.img"
  :outputSize="option.size"
  :outputType="option.outputType"
></vueCropper>
nametoDodefaultoptional
imgimg urlnullurl || base64 || blob
outputSizecrop produces quality of pictures10.1 - 1
outputTypecrop img output typejpg (jpg need jpeg)jpeg || png || webp
infocrop box size showtruetrue || false
canScalethe scroll to scaletruetrue || false
autoCropauto create crop boxfalsetrue || false
autoCropWidthauto crop box widthbox size 80%0~max
autoCropHeightauto create crop box heightbox size 80%0~max
fixedopen crop box width height ratiotruetrue | false
fixedNumbercrop box width height ratio[1 : 1][w : h]

function adopt this.$refs.cropper to use

start cropper
this.$refs.cropper.startCrop()
stop cropper
this.$refs.cropper.stopCrop()
clear cropper
this.$refs.cropper.clearCrop()
get output img base64
this.$refs.cropper.getCropData((data) => {
  // do something
  console.log(data)  
})

get output img blob

this.$refs.cropper.getCropBlob((data) => {
  // do something
  console.log(data)  
})

Keywords

FAQs

Package last updated on 19 Jun 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc