Just started learning Vue JS and encountered a small issue
I'm currently looping through an array with a button inside the div I'm iterating over
The goal is to grab the data of the selected item after clicking on the button
For example, suppose I have an array like this numbers: [1,2,3,4,5]
and I'm looping through it in this manner
<div v-for="number in numbers">
<p>{{ number }}</p>
<button v-on:click="getTheSelectedOne"> Get The Value </button>
</div>
I attempted the following
<button v-on:click="getTheValueOfTheSelectedOne(number)"> Get The Value </button>
but encountered an error. How can I achieve the desired outcome?