康巴易测肤/伤疤uniapp小程序类
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 kuukausi sitten
1234567891011121314151617181920212223242526272829303132333435363738
  1. # 标题
  2. ### 使用说明
  3. ```
  4. import imageCropping from '../../components/image-cropping'
  5. components:{imageCropping}
  6. <image-cropping
  7. v-if="imageUrl"
  8. :src="imageUrl"
  9. :isFixedSize="true"
  10. :ratioGroup="['4:3', '1:1']"
  11. @completed="cropCompleted"
  12. @cancel="cropCancel" >
  13. </image-cropping>
  14. ```
  15. ### 属性
  16. | 属性 | 类型 | 默认值 | 备注 |
  17. | --- | --- | --- | --- |
  18. | src | String | "" | 需要裁剪的图片路径 |
  19. | ratioGroup | Array | [] | 设置比例数组 |
  20. | isFixedSize | Boolean | false | 是否固定裁剪尺寸大小 |
  21. | cropShape | String | 'rect' | 裁剪的形状,rect:矩形;circular:圆形 |
  22. ### 事件
  23. | 事件名称 | 说明 | 返回 |
  24. | --- | --- | --- | --- |
  25. | completed | 点击确定按钮 | e:{tempFilePath} |
  26. | cancel | 点击取消按钮 | 无 |
  27. ### 其他说明
  28. 1. 组件截图保存采用微信小程序离屏canvas实现(uni.createOffscreenCanvas),所以咱支持微信小程序组件
  29. 2. 裁剪的图片默认导出为base64格式,为方便使用、上传图片,组件转换base64图片为临时路径(tempFilePath)