1.0.0 • Published 9 months ago

@toowe/imagecropper v1.0.0

Weekly downloads
-
License
-
Repository
-
Last release
9 months ago

vue3图片裁剪组件

1、安装

pnpm install @toowe/imagecropper

2、定义传输实体和对应的处理器

import { ImageCropper } from '@toowe/imagecropper';

<ImageCropper :file="file" @done="finish" @preview="preview" :width="200" :height="200"></ImageCropper>

3、参数

参数名类型说明是否必填默认值
fileFile图片文件
widthnumber裁剪宽度(单位px)100
heightnumber裁剪高度(单位px)100

4、事件

function done(data: Blob) {
  console.log('final image data:', data)
}
function preview(html: string) {
  previewDiv.innerHTML = html;
}
1.0.0

9 months ago