I am retrieving an object of objects, for each object I am making a list of text inputs to edit their values. My problem is that the value of the input is not changing so it only submits with the starting value, how can I make the input value dynamic?
<ul>
<li v-for="variable in variables">
<input type="text" :value="variable.value" />
<button @click="updateVariable(variable.id, variable.value)">Update</button>
</li>
</ul>
...
methods: {
updateVariable(id, value) {
axios.post('/destination', {
params: {
id: id,
value: value
}
})
.then((response) => {
console.log(response);
})
.catch((error) => {
console.log(error);
})
}
}