2.0.3 • Published 4 years ago
svelte-imgcrop v2.0.3
svelte-imgcrop
A svelte component for image crop. (Svelte 图片裁剪组件)
Demo 示例
Brower compatibility
IE10+
Env 环境
svelte@3 + rollup@2
Install 安装
npm install svelte-imgcrop
Usage 使用
<script lang="ts">
import ImgCrop from "svelte-imgcrop";
let img = "/images/demo.png";
</script>
<ImgCrop src={img} />
Options 配置项
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) |