# ax-clipper

> This is a simple cropper tool based on mpvue

Latest version **0.0.4** (published 2018-11-07) · 0 weekly downloads

## Install

```sh
npm install ax-clipper
pnpm add ax-clipper
yarn add ax-clipper
bun add ax-clipper
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2018-11-07 |
| First published | 2018-11-07 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 13.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Alexi_Xiang |
| Maintainers | alexixiang |

## Links

- npm: https://www.npmjs.com/package/ax-clipper
- npm.io page: https://npm.io/package/ax-clipper

## Recent versions

- 0.0.4 (latest) — 2018-11-07
- 0.0.3 — 2018-11-07

## README

## 开始
```
npm install ax-clipper --save
```

```html
<template>
    <ax-clipper
        :imgPath="imgPath"
        @chooseImage="chooseImage"
        @success="success">
    </ax-clipper>
</template>
```
```js
import axClipper from 'ax-clipper'
export default {
    components: {
        axClipper
    },
    data() {
        return {
            imgPath: ''
        }
    },
    methods: {
        // 剪裁成功图片
        success(resPath) {
            // resPath：剪裁成功的图片临时路径
            console.log(resPath)
        },
        // 选择图片
        chooseImage() {
            wx.chooseImage({
                count: 1, // 最多可以选择的图片张数，默认9
                sizeType: ['original', 'compressed'], // original 原图，compressed 压缩图，默认二者都有
                sourceType: ['album', 'camera'], // album 从相册选图，camera 使用相机，默认二者都有
                success: res => {
                    this.imgPath = res.tempFilePaths[0]
                },
                fail: error => {
                    console.log(error)
                }
            })
        }
    }
}
```

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