update coordiantes

This commit is contained in:
Tyrel Souza 2018-04-13 13:47:10 -04:00
parent 1ac671e702
commit b462dbc8ad
No known key found for this signature in database
GPG Key ID: 5A9394D4C30AEAC0
2 changed files with 8 additions and 1 deletions

8
app.js
View File

@ -1,11 +1,17 @@
var app = new Vue({ var app = new Vue({
el: '#app', el: '#app',
data: { data: {
counter: 0 counter: 0,
x: 0,
y: 0,
}, },
methods:{ methods:{
click(){ click(){
this.counter++; this.counter++;
},
updateCoordinates(event){
this.x = event.clientX;
this.y = event.clientY;
} }
} }
}) })

View File

@ -9,6 +9,7 @@
<div id='app'> <div id='app'>
<button @click="click">Click Me</button> <button @click="click">Click Me</button>
<p>{{ counter }}</p> <p>{{ counter }}</p>
<p v-on:mousemove="updateCoordinates">Coordinates {{x}} {{y}} </p>
</div> </div>
<script src="app.js" charset="utf-8"></script> <script src="app.js" charset="utf-8"></script>