I'm using VueJs2. Component A consists of two components, B and C, and also contains a submit button. each of the child components have an input element. When A's submit button is clicked, I need to get input from B and C and submit them in a single post request.
"Component A"
var A = {
components: {
'B',
'C',
},
template: `<input type="button" value="submit" id="submit" v-on:click="submitMethod" />`,
methods: {
submitMethod: function() {
}
}
}
"Component B"
var B = {
template: `<input type="text" id="fname" v-model="fname" />`,
data: {
fname: ''
}
}
"Component C"
var C = {
template: `<input type="text" id="lname" v-model="lname" />`,
data: {
lname: ''
}
}
How may I achieve this?