update coordiantes
This commit is contained in:
parent
1ac671e702
commit
b462dbc8ad
8
app.js
8
app.js
@ -1,11 +1,17 @@
|
||||
var app = new Vue({
|
||||
el: '#app',
|
||||
data: {
|
||||
counter: 0
|
||||
counter: 0,
|
||||
x: 0,
|
||||
y: 0,
|
||||
},
|
||||
methods:{
|
||||
click(){
|
||||
this.counter++;
|
||||
},
|
||||
updateCoordinates(event){
|
||||
this.x = event.clientX;
|
||||
this.y = event.clientY;
|
||||
}
|
||||
}
|
||||
})
|
||||
|
@ -9,6 +9,7 @@
|
||||
<div id='app'>
|
||||
<button @click="click">Click Me</button>
|
||||
<p>{{ counter }}</p>
|
||||
<p v-on:mousemove="updateCoordinates">Coordinates {{x}} {{y}} </p>
|
||||
</div>
|
||||
|
||||
<script src="app.js" charset="utf-8"></script>
|
||||
|
Loading…
Reference in New Issue
Block a user