JSFiddle - React, Tailwind, and code Playground
by Wosley Bago
HTML
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script>
<div id="app">
<button @click="counter++">Click me</button>
<p>{{ counter }}</p>
<p @mousemove="updatecoordinates">{{x}} / {{y}}- <span v-on:mousemove.stop>DEAD SPOT</span></p>
<a href="https://google.com" @click.stop.prevent>Click me</a>
</div>
JavaScript
new Vue({
el: '#app',
data: {
counter: 0,
x: 0,
y: 0
},
methods: {
updatecoordinates: function(event){
this.x = event.clientX;
this.y = event.clientY;
}
}
})