i have this on vue template:
<div v-for="item in items" :key="item.id">
<!-- content -->
</div>
i want get the value of item.id and send via axios.
i dont know how bind de value from template to script section.
You can put a button with a on click handler inside the div:
<div v-for="item in items" :key="item.id">
<button @click="sendItem(item.id)">Send</button>
</div>
And define the handler in methods
section:
<script>
export default {
data: ...
methods: {
sendItem: function(itemId) {
// Using axios here
}
}
}
</script>