项目作者: bestvist

项目描述 :
A vue component for image crop.
高级语言: Vue
项目地址: git://github.com/bestvist/vue-imgcrop.git
创建时间: 2020-05-06T08:13:17Z
项目社区:https://github.com/bestvist/vue-imgcrop

开源协议:MIT License

下载


vue-imgcrop

npm version
npm downloads
MIT

A vue component for image crop. (Vue 图片裁剪组件)

Demo 示例

click me

Env 环境

vue@2 + vue-cli3

Install 安装

  1. npm install vue-imgcrop

Usage 使用

  1. <div>
  2. <VueImgCrop @change="handleChange"></VueImgCrop>
  3. </div>
  4. <script lang="ts">
  5. import { Component, Vue } from 'vue-property-decorator';
  6. import { VueImgCrop } from 'vue-imgcrop';
  7. @Component({
  8. components: {
  9. VueImgCrop
  10. }
  11. })
  12. export default class App extends Vue {
  13. private handleChange(imgData) {
  14. console.log(imgData);
  15. },
  16. };
  17. </script>

Options 配置项

| Prop | Type | Default | Desc |
| format | Array | [‘jpg’, ‘png’, ‘bmp’, ‘jpeg’] | limit image format |
| size | Number | 5 | limit image size |
|—|—|—|—|