Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <body>
- <div id="app">
- <button v-on:click="increase(4)">Click</button>
- <button v-on:click="counter++">Click</button>
- <p>{{ counter > 10 ? 'Greater than 10' : 'Lower than 10' }}</p>
- <p v-on:mousemove="updateCoordinates">
- Coordinates {{x}}|{{y}}- <span v-on:mousemove.stop="">DEAD SPOT</span>
- </p>
- <input type="text" v-on:keyup.enter.space="alertMe">
- </div>
- <script>
- new Vue({
- el: '#app',
- data: {
- counter: 0,
- x: 0,
- y: 0
- },
- methods: {
- increase: function(step){
- this.counter += step;
- },
- updateCoordinates: function(event){
- this.x = event.clientX;
- this.y = event.clientY;
- },
- alertMe: function () {
- alert('Alert');
- }
- }
- });
- </script>
- </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement