update title with changeTitle
This commit is contained in:
parent
bcbae5539e
commit
63f2d9f743
5
app.js
5
app.js
|
@ -2,5 +2,10 @@ var app = new Vue({
|
|||
el: '#app',
|
||||
data: {
|
||||
title: "Hello world."
|
||||
},
|
||||
methods:{
|
||||
changeTitle(event){
|
||||
this.title = event.target.value
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
</head>
|
||||
<body>
|
||||
<div id='app'>
|
||||
<input type="text" v-on:input="changeTitle">
|
||||
<p>{{ title }}</p>
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user