When the mouse hovers over a card, I want only that specific card to show a hover effect. Currently, when I hover over any card, all of them show the hover effect.
Is there a way to achieve this in Vue Nuxtjs?
Here's what I am trying to accomplish: When the mouse hovers over a card, it should play a GIF, and when the mouse moves away, it should display a static image.
This is my code:
<div v-b-hover="handleHover" class="team-img">
<img
v-if="isHovered"
:srcset="member.node.teamMemberFields.imageGif"
/>
<img v-else :srcset="member.node.teamMemberFields.image.srcSet" />
</div>
And here is the script code:
import gql from 'graphql-tag'
export default {
data() {
return {
isHovered: false,
}
},
methods: {
handleHover(hovered) {
this.isHovered = hovered
},
},
...