JSFiddle - React, Tailwind, and code Playground
by Shin Okada
HTML
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<div id="app">
<button v-on:click="increase">Click me</button>
<p>{{ counter }}</p>
<p v-on:mousemove="updateCoordinates">
Coordinates: {{ x }} / {{ y }}
- <span v-on:mousemove.stop="">Dead Spot</span>
</p>
</div>
JavaScript
new Vue({
el: '#app',
data: {
counter: 0,
x :0,
y: 0,
},
methods: {
increase: function() {
this.counter++;
},
updateCoordinates: function(event) {
this.x = event.clientX;
this.y = event.clientY;
}
}
});