I'm currently working on a project using Vue JS and I've encountered an issue.
Here is the code snippet causing me trouble:
<input v-model="spam" @keyup="spamegg=true;" @blur="spamegg=false;" />
<div v-if="spamegg" class="someclass">
<a v-for="str in arr" @click.prevent="foobar(); barbaz();" href="#">{{ str }}</a>
</div>
Although I have defined foobar
method as:
foobar: function() {
console.log('clicked');
}
The click
event doesn't seem to be triggering. The same issue persists with the barbaz
function.
Coincidentally, when I tested it with the @mouseover
event, it worked fine.
For reference, the div
element behaves like a dropdown in terms of CSS styling.
If you require any additional information, please feel free to ask.