禁用鼠标悬停暂停
组件可以通过 pausedOnHover
属性来控制鼠标悬停时是否暂停滚动,默认值为 true
。如果传递 false
,则鼠标悬停时不会暂停滚动。
vue
<script setup lang="ts">
import { LoopScroll } from "@joyday/vue-loop-scroll";
const dataSource = [
"1. scrolling scrolling scrolling",
"2. scrolling scrolling scrolling",
"3. scrolling scrolling scrolling",
"4. scrolling scrolling scrolling",
];
</script>
<template>
<div class="box">
<LoopScroll :dataSource :pausedOnHover="false"></LoopScroll>
</div>
</template>
<style scoped>
.box {
height: 150px;
border: 1px solid red;
:deep(.scroll-loop-item) {
border-bottom: 1px dashed #000;
padding: 10px 4px;
}
}
</style>