{
el: '#vu-app',
data: {
inputs: [],
},
methods : {
addInputButton : function (event) {
this.inputs.push('Кнопка');
},
myFunc(index){
alert('Нажата кнопка '+index);
}
}
}
<div id="container">
<button v-on:click="addInputButton">Add Input</button>
<input
v-for="(inp, index) in inputs"
:key="index"
:value="inp"
type="button"
@click="myFunc(index)"
/>
<div>