npm i select-image-area
<template>
<div>
<img ref="img" @moving="getEventDataArea" @resizing="getEventDataArea" :src="image.url" alt="">
</div>
</template
<script>
import selectImageArea from "./src/main.ts"
export default {
data() {
return {
area: {}
}
},
methods: {
selectArea() {
selectImageArea(this.$refs.img, {...this.area})
},
getEventDataArea(e) {
this.area = {coordinates: {...e.detail.coordinates}, size: {...e.detail.size}}
},
}
</script>
- minHeight:
number
- minWidth:
number
- coordinates: x
number
ynumber
- size: w
number
hnumber