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({
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -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>
|
||||||
|
Loading…
Reference in New Issue
Block a user