【发布时间】:2019-05-30 05:32:05
【问题描述】:
所以我的 Vue 页面上有以下 HTML
<div v-for="profile in lab.profiles" v-if="edit || profile.active" class="lab-tests-row-div" @mouseover="">
<div class="clickBox" :class="['clickBox-' + lab.id + '-' + profile.id]" @click="openInfoPopup"></div>
<p class="lab-tests-row test-info-row" v-bind:class="{'active': profile.active}">
<span v-bind:class="{'opacity50':!profile.active}">{{profile.name}}</span>
<i v-if="edit" class="fa fa-minus pull-right removeTestIcon" aria-hidden="true" @click="toggleProfile(lab.id, profile.id)"></i>
<span class="pull-right" v-bind:class="{'opacity50':!profile.active}">{{profile.code}}</span>
</p>
</div>
我想在用户将鼠标悬停在该行上时显示元素“clickBox”,如果我使用带有布尔值的 v-if 并在鼠标悬停时更改它,它们都会显示,因为它们在 v-for 中,我如何只在他们悬停的行中显示 div?
【问题讨论】:
标签: javascript vue.js javascript-framework v-for