update title with changeTitle

This commit is contained in:
Tyrel Souza 2018-04-13 10:56:49 -04:00
parent bcbae5539e
commit 63f2d9f743
No known key found for this signature in database
GPG Key ID: 5A9394D4C30AEAC0
2 changed files with 6 additions and 0 deletions

5
app.js
View File

@ -2,5 +2,10 @@ var app = new Vue({
el: '#app', el: '#app',
data: { data: {
title: "Hello world." title: "Hello world."
},
methods:{
changeTitle(event){
this.title = event.target.value
}
} }
}) })

View File

@ -7,6 +7,7 @@
</head> </head>
<body> <body>
<div id='app'> <div id='app'>
<input type="text" v-on:input="changeTitle">
<p>{{ title }}</p> <p>{{ title }}</p>
</div> </div>