【Vue】vue3中使用swipe竖直方向上滚动

安装

shell 复制代码
npm install swipe

使用

ts 复制代码
import 'swiper/css';
import 'swiper/css/mousewheel';
import { Swiper, SwiperSlide } from 'swiper/vue';
import { Mousewheel } from 'swiper/modules';

containerHeight 是容器的高度,一定要设置竖直方向上滚动高度,不然会非常高!!

html 复制代码
      <swiper
        direction="vertical"
        :modules="[Mousewheel]"
        :mousewheel="{
          enabled: true,
        }"
        :speed="1500"
        :slides-per-view="1"
        :style="{ height: containerHeight + 'px' }"
      >

文档

https://swiperjs.com/vue
https://swiperjs.com/swiper-api#mousewheel-control

相关推荐
UI设计兰亭妙微6 小时前
资金运营管理监控系统交互设计、UI设计及VUE开发
vue.js·ui·交互
王子肥波6 小时前
🚀 TabTab Admin:一款现代化的 Vue 3 后台管理系统模板
vue.js
whatever who cares6 小时前
Java Web 架构全组件详解
java·前端·架构
DevDengChao6 小时前
[Aliyun] [FC] 如何使用 website-fc-serve 插件部署静态网站
前端·后端
前端拿破轮6 小时前
利用Github Page + Hexo 搭建专属的个人网站(一)
前端·人工智能·后端
q1cheng6 小时前
基于Spring Boot + Vue项目online_learn的用户登录认证全流程分析
前端
大时光6 小时前
gsap 配置解读 --2
前端
万岳科技程序员小金7 小时前
AI数字人小程序源码开发全流程实战:前端交互+后端算法部署指南
前端·人工智能·软件开发·ai数字人小程序·ai数字人系统源码·ai数字人软件开发·ai数字人平台搭建
白开水丶7 小时前
vue3源码学习(五)ref 、toRef、toRefs、proxyRefs 源码学习
前端·vue.js·学习
广州华水科技7 小时前
单北斗GNSS在变形监测中的应用与优势分析
前端