Skip to content

Commit b613318

Browse files
authored
feat: add skipHover prop to deactive the hover detection (#752)
1 parent 59f3f1b commit b613318

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/components/RecycleScroller.vue

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
:key="view.nr.id"
3030
:style="ready ? { transform: `translate${direction === 'vertical' ? 'Y' : 'X'}(${view.position}px)` } : null"
3131
class="vue-recycle-scroller__item-view"
32-
:class="{ hover: hoverKey === view.nr.key }"
33-
@mouseenter="hoverKey = view.nr.key"
34-
@mouseleave="hoverKey = null"
32+
:class="{ hover: !skipHover && hoverKey === view.nr.key }"
33+
@mouseenter="!skipHover && (hoverKey = view.nr.key)"
34+
@mouseleave="!skipHover && (hoverKey = null)"
3535
>
3636
<slot
3737
:item="view.item"
@@ -118,6 +118,11 @@ export default {
118118
type: Boolean,
119119
default: false,
120120
},
121+
122+
skipHover: {
123+
type: Boolean,
124+
default: false,
125+
},
121126
},
122127
123128
data () {

0 commit comments

Comments
 (0)