'Vue 3.2 Passing props to an event or a function argument

I'm trying to build a webapp with Vue. I have a component that serves as a template and a vue where I use the template and fill it with props.

For this I have an array from which I retrieve data from :

<MyComponent :myArray="[{dataName: 'dataValue'}] />

It works fine usually but not when I try to pass the prop as a function argument. In MyComponent :

<table>
    <tr v-for="item in myArray" :key='item.id'>
        <td>
            <button @click="myFunction( {{ item.dataName }} )">ClickMe</button>
        </td>
    </tr>
</table>

I tried to pass the argument and to pass the entire function name + argument but neither worked. What am I doing wrong ?

Thank you, Nehrz



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source