How to deal with the problem of mouse entering, mouse leaving and content drop-down menu not disappearing in Vue.js 2
P粉226667290
2023-08-28 12:58:10
<p>Hi everyone, I would like to know how to use <code>@mouseenter</code> and <code>@mouseleave</code> to control the dropdown content instead of making it disappear</p>
<pre class="brush:php;toolbar:false;"><div class="wrapper">
<div class="link" @mouseenter="show = true" @mouseleave="show = false">project</div>
<div class="content" v-if="show">This is content</div>
</div></pre>
<p>I tried something like this but I don't know how to handle it when I want to hover over or interact with the content, hope you guys can help me. Thank you in advance. </p>
Try to move the
@mouseleave
event intocontent
: