0
I’m learning how to work with Vue.js, and I need something relatively simple but I couldn’t solve, generate inputs dynamically in a form. Basically the form already comes with an input, and whenever you click the add button you have to add one more input, can help me?
<template>
<form method="POST" action="">
<div class="name">
<h5><b>Nome da Seção: </b></h5>
<input type="text" class="form-control" id="nome" placeholder="Digite aqui o nome da seção">
</div>
<hr>
<div id="idDiv">
<h5>Digite os Itens:</h5>
<input type="text" class="form-control" id="item" placeholder="Digite o nome do Item" style="max-width:300px;">
</div>
<hr>
<div class="submit">
<button class="btn btn-outline-secondary" type="button" style="min-width:150px;">Adicionar</button>
<button class="btn btn-outline-secondary" type="button" style="min-width:150px;">Enviar</button>
</div>
</form>
</template>
<script>
export default {
}
</script>
Luiz maybe something like that? https://codesandbox.io/s/goofy-river-0o18k?file=/src/App.See This part of the documentation: https://br.vuejs.org/v2/guide/list.html
– José Eduardo Kimura
thank you very much
– LuizFernando
@Could Joséeduardokimura copy this code for the answer (and the link)? only the link is little to answer, but your solution is good and would give a good answer for me
+1
;)– Sergio