0👍
You can store a variable in data and use v-for in your form.
<form v-for="(form,index) in numberofForms" :key="index"
@submit.prevent = "numberofForms++" >
<b-form-input id="name" v-model="name" type="text" required/>
... other codes needs to copy
<b-button type="submit">Save</b-button>
</form>
export default {
...
data() {
return {
numberofForms: 1,
}
},
};
- [Vuejs]-TypeError: Cannot read property '' of undefined
- [Vuejs]-Vue.js remove object from list with two-way binding
Source:stackexchange.com