After discussing the principle of events in VUE in the last chapter, this chapter goes a little further. In other words, more exciting exercises, e.g.
<div id="app">
<button v-on:click="count++">Clicked {{ count }} times</button>
</div>
<script>
new Vue({
el: '#app',
data: {
count: 0
}
})
</script>
<div id="app">
<p v-on:mouseover="message = 'Mouse is over the text!'">{{ message }}</p>
</div>
<script>
new Vue({
el: '#app',
data: {
message: 'Hover over me!'
}
})
</script>