Full-Stack Web Development with Vue.js and Node

(singke) #1
Building the Real Application Chapter 5

If we visit the URL (http://localhost:8080/#/), we can see the following:


v-on


This directive is used for event handling. We can use this to trigger some logic in your
application. For example, let's say we want to reply to a question that we did in the last


example, for that we can do the following. Change the code


in src/components/Home.vue to the following:


<template>
<v-layout row wrap>
<v-flex xs12>
<div v-text="message"></div>
</v-flex>
<v-flex xs12>
<v-btn color="primary" v-on:click="reply">Reply</v-btn>
</v-flex>
</v-layout>
</template>
<script type="text/javascript">
export default {
data() {
Free download pdf