Is there a way to store multiple values in data return when its been submitted.
View
<div id="app">
<input type="text" v-model="inserted" placeholder="Insert Name">
<button type="submit" v-on:click='submit();'>SUBMIT</button>
</div>
Script
new Vue({
el: "#app",
data: {
inserted:[], /** each name submitted should be stored over here **/
/** if the first name was submitted as DAVID and second name was submitted as JOHN **/
/** inserted[] should consists of both values as ["DAVID", "JOHN"] **/
},
methods: {
submit(){
console.log('value submitted');
}
}
})
Below is my code on JSFIDDLE