I have this html code:
<div id="app">
<input type="text" name="username" value="user.name">
</div>
With this Vue.js code:
new Vue({
el: '#app',
data: {
user: {
name: 'John Doe',
age: 20
},
// etc...
}
});
How can I show the Vue's data.user.name propertie's value in input filed?
If I try this:
<input type="text" name="username" v-model="user.name" value="user.name">
Then it says user is not defined