1、局部引入
import vueSeamlessScroll from "vue-seamless-scroll";
2、注册
components: {
vueSeamlessScroll,
},
3、使用
<vue3-seamless-scroll :list="list1" class="scroll" step="0.2"><div class="item" v-for="(item1, i1) in list1" :key="i1"><div class="item11"><div class="num">{{ item1.num }}</div><div class="title">{{ item1.title }}</div><div class="lineWidth"><div:style="{ width: item1.number / 100 + '%' }"style="background-color: #87f7c7; height: 100%"></div></div><div class="number">{{ item1.number }}</div></div></div></vue3-seamless-scroll>
step参数是用来调整滚动速度的,数值越小,滚动速度越小