I am currently working on a navbar with dynamic component navigation, where hovering over a navbar-link should display the corresponding component and hiding it when the mouse leaves. Although the components are displayed correctly upon hover, they do not disappear or respond to the "mouseleave" event as expected. Here is an example of the code being used:
Even after trying other events like @click
, the issue persists.
<keep-alive>
<component :is="selectedComponent" v-if="showComponent" @mouseleave="showComponent = false"></component>
</keep-alive>
The desired outcome is for the component to disappear on mouseleave
.