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

vue-polygon-cropper

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-polygon-cropper

Vue polygon cropper lets you to crop image with any numbers of points with redo and undo functionality.

  • 0.7.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

vue-polygon-cropper

Vue polygon cropper lets you to crop image with any numbers of points with redo and undo functionality.

NPM

Installation

npm install --save vue-polygon-cropper

or with yarn

yarn add vue-polygon-cropper

Demo

Checkout here gobeam.github.io/vue-polygon-cropper/

Example

Full Example with implementation here Example

Usage

// Global
import Vue from 'vue';
import VuePolygonCropper from 'vue-polygon-cropper';
Vue.component(VuePolygonCropper);

// Local
import VueCropper from 'vue-polygon-cropper';
export default {
  components: { VueCropper}
}

...
     <template>
         <div id="app">
             <polygon-crop :imageSource="'/demo.png'" ref="canvas"></polygon-crop>
             <button @click.prevent="crop">Crop</button>
             <button @click.prevent="undo">Undo</button>
             <button @click.prevent="redo">Redo</button>
             <button @click.prevent="reset">Reset</button>
     
         </div>
     </template>
     <script>
     
     	export default {
     		name: 'App',
     		methods: {
     			crop: function () {
     				this.$refs.canvas.crop();
     			},
     			undo: function () {
     				this.$refs.canvas.undo();
     			},
     			redo: function () {
     				this.$refs.canvas.redo();
     			},
     			reset: function () {
     				this.$refs.canvas.reset();
     			}
     		}
     	};
     </script>
...

Options

NameTypeRequiredDescription
imageSourceStringrequiredImage url or base64 to load on canvas.
canvasClassStringoptionalPass class to canvas to load your custom style.
wrapperClassStringoptionalPass class to div wrapper of canvas to load your custom style.
pointerClassStringoptionalPass class to pointer to load your custom style and customize it.
showCanvasBooleanoptionalDefault true but pass false in order to hide image canvas.
showPointerBooleanoptionalDefault true but pass false in order to hide pointers.
widthNumberoptionalPass width to canvas.
heightNumberoptionalPass height to canvas.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

Released under the MIT License - see LICENSE.txt for details.

Keywords

FAQs

Package last updated on 31 May 2021

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