So I have this basic VUE.js page, but I want variable C to be a composite of variable A and B together.
var app = new Vue({
el: '#app',
data: {
firstname: '',
lastname: '',
fullname: firstname + lastname
}
})
so I can use it in a <input type="text" v-model="fullname"> and it will contain the values of firstname and lastname.
firstname and lastname will be binded to 2 other inputs as follows:
<label>Insert your first name:</label>
<input type="text" v-model="firstname">
<label>Insert your last name:</label>
<input type="text" v-model="lastname">
so the fullname variable will be a dynamically binded firstname + lastname variable.
I've tried several things but I can't seem to get this working.
inputwhat do you expect to happen when the user changes the fullname input. Do you expect the value to be split out into first name and last name and how do you expect to accomplish that? By spaces? Etc.