0๐
โ
You can use the mouse-up event(v-on:mouseup
).
<template>
<div v-on:mousedown="down($event)" v-on:mouseup="up($event)" style="background-color:blue; width:500px;height:500px">
</div>
</template>
<script>
export default {
name: 'App',
data () {
return {}
},
methods: {
up: function (e) {
console.log('X: ' + e.offsetX + ' Y: ' + e.offsetY)
},
down: function (e) {
console.log('X: ' + e.offsetX + ' Y: ' + e.offsetY)
}
}
}
</script>
Source:stackexchange.com