A svelte component for image crop. (Svelte 图片裁剪组件)
svelte@3 + rollup@2
npm install svelte-imgcrop
<script lang="ts">
import ImgCrop from "svelte-imgcrop";
let img = "/images/demo.png";
</script>
<ImgCrop src={img} />
Prop
Prop | Type | Default | Desc |
---|---|---|---|
src | string | '' | The image to be cropped |
width | Number | 400 | Container width |
height | Number | 300 | Container height |
Events
Name | Desc |
---|---|
change | Crop success,params(e) |