# @klesh/vue-crop

> Light-weight Vue.js component for photo cropping with zooming/dragging support

Latest version **1.0.0** (published 2019-07-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install @klesh/vue-crop
pnpm add @klesh/vue-crop
yarn add @klesh/vue-crop
bun add @klesh/vue-crop
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2019-07-20 |
| First published | 2019-07-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 46.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Klesh Wong |
| Maintainers | kleshwong |
| Keywords | crop, Vue, labelling |

## Links

- npm: https://www.npmjs.com/package/@klesh/vue-crop
- Repository: https://github.com/klesh/vue-crop
- Issues: https://github.com/klesh/vue-crop/issues
- npm.io page: https://npm.io/package/@klesh/vue-crop

## Recent versions

- 1.0.0 (latest) — 2019-07-20
- 0.1.0 — 2019-07-18

## README

# VueCrop
VueCrop is a lightweight cropping component less than 250 lines of code all in a single file, no external dependency, and yet still, provides suffient functionalities for photo cropping

# Demo

https://klesh.github.io/vue-crop

# Usage

## CDN

```vue
<script src="https://unpkg.com/vue@2.6.10/dist/vue.min.js"></script>
<script src="https://unpkg.com/@klesh/vue-crop@1.0.0/dist/vue-crop.min.js"></script>

<template>
  <div>
    <vue-crop src="photo.jpg" :ratio="ratio" v-model="box" @change="done"></vue-crop>
  </div>
</template>

<script>
var app = new Vue({
  el: '#app',
  data: {
    ratio: 0,
    box: null,
  },
  methods: {
    done() {
      console.log('done');
    }
  }
});
</script>
```

## ESM
```vue
<template>
  <div>
    <vue-crop src="photo.jpg" :ratio="ratio" v-model="box" @change="done"></vue-crop>
  </div>
</template>

<script>
import VueCrop from 'https://unpkg.com/@klesh/vue-crop@1.0.0/dist/vue-crop.esm.js';

var app = new Vue({
  el: '#app',
  components: {VueCrop},
  data: {
    ratio: 0,
    box: null,
  },
  methods: {
    done() {
      console.log('done');
    }
  }
});
</script>
```

## NPM
```shell
$ npm install @klesh/vue-crop
```

```js
import VueCrop from '@klesh/vue-crop';

var app = new Vue({
  el: '#app',
  components: {VueCrop},
  data: {
    ratio: 0,
    box: null,
  },
  methods: {
    done() {
      console.log('done');
    }
  }
});
```

---
_Source: https://npm.io/package/@klesh/vue-crop · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
