1.0.2 • Published 5 years ago
cropper-component v1.0.2
说明
一个简单的裁剪图片组件(react)
安装
yarn add cropper-component
使用
import CropperComponent from 'cropper-component'
// react code
onCrop = (blob, url) => {
// coding
}
render() {
<CropperComponent onCrop={this.onCrop}/>
}
props
name | desc | type | default |
---|---|---|---|
imageSrc | 图片地址 | string | 必须 |
aspect | 裁剪框比例(width/height) | number | 1 |
shape | 裁剪形状 | string | 可选rect、round(todo),默认rect |
onCrop | 剪裁按钮事件 | function | null |
onCancel | 取消事件 | function | null |