I am iterating through an array of objects containing map svg paths
and locales
, and I want to execute a function on load. The function needs to take the locale keys
from the paths
array as a parameter and perform some operation:
<p v-for="(country, locale) in paths" @load="myFunction(locale)">log {{locale}}</p>
However, the @load
directive does not seem to work. Oddly enough, when using the @click
directive instead, it works as expected:
<p v-for="(country, locale) in paths" @click="myFunction(locale)">log {{locale}}</p>
This is the function being called:
const myFunction = (locale) => {
console.log(locale)
}
How can I get the @load directive to function properly?