Created
June 11, 2019 03:40
-
-
Save bhaveshdaswani93/aee9fa3d02f5e7efbf1742f64b956b09 to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/qamudid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
<!-- development version, includes helpful console warnings --> | |
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> | |
</head> | |
<body> | |
<div id="app"> | |
<button v-on:click='increaseCounter(2,$event)'>Click me</button> | |
<p>{{ counter }}</p> | |
<p v-on:mousemove="updateCoordinates">{{ x }},{{ y }}</p> | |
</div> | |
<script id="jsbin-javascript"> | |
new Vue({ | |
el:'#app', | |
data:{ | |
x:0, | |
y:0, | |
counter:0 | |
}, | |
methods:{ | |
updateCoordinates:function(event){ | |
// console.log(event), | |
this.x=event.clientX; | |
this.y = event.clientY; | |
}, | |
increaseCounter:function(step,event) | |
{ | |
this.counter +=step; | |
// console.log(event); | |
} | |
} | |
}); | |
</script> | |
<script id="jsbin-source-javascript" type="text/javascript">new Vue({ | |
el:'#app', | |
data:{ | |
x:0, | |
y:0, | |
counter:0 | |
}, | |
methods:{ | |
updateCoordinates:function(event){ | |
// console.log(event), | |
this.x=event.clientX; | |
this.y = event.clientY; | |
}, | |
increaseCounter:function(step,event) | |
{ | |
this.counter +=step; | |
// console.log(event); | |
} | |
} | |
});</script></body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new Vue({ | |
el:'#app', | |
data:{ | |
x:0, | |
y:0, | |
counter:0 | |
}, | |
methods:{ | |
updateCoordinates:function(event){ | |
// console.log(event), | |
this.x=event.clientX; | |
this.y = event.clientY; | |
}, | |
increaseCounter:function(step,event) | |
{ | |
this.counter +=step; | |
// console.log(event); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment