效果
20231116092014
添加mousewheelControl: true,
这个属性即可
<div class="swiper-container"><div class="swiper-wrapper"><div class="swiper-slide" > <div class="" style="height: 100%; background-color: #ccc;">111</div></div><div class="swiper-slide"><div class="" style="height: 100%; background-color: #8b8b8b;">222</div></div><div class="swiper-slide"><div class="" style="height: 100%; background-color: #202020;">333</div></div></div>
</div><script>var mySwiper = new Swiper('.swiper-container', {speed: 1000,direction: 'vertical',height : window.innerHeight,mousewheelControl: true,forceToAxis: true,}) </script>