vue 无限滚动插件 vue-seamless-scroll

1.安装

javascript 复制代码
npm install vue-seamless-scroll --save

**

2.页面注册使用

**

javascript 复制代码
//页面
//注:tablesRow 为 overflow hidden
 <div class="tablesRow">
     <vue-seamless-scroll :data="study2table"  :class-option="classOption1">
       //下边是要滚动的内容
        <el-row class="box" v-for="(item,index) in study2table" :key="index">
             <el-col :span="8"><div class="grid-content bg-purple-dark">{{index+1}}</div></el-col>
             <el-col :span="8"><div class="grid-content bg-purple-dark">{{item.userName?item.userName:"游客"}}</div></el-col>
             <el-col :span="8"><div class="grid-content bg-purple-dark">{{item.learningCount?item.learningCount :0}}</div></el-col>
         </el-row>
    </vue-seamless-scroll>
</div>
//引入
import vueSeamlessScroll from 'vue-seamless-scroll'
//注册
 components: {
    vueSeamlessScroll
 },
 //调用
  computed:{
    classOption1 () {//滚动的参数
      return {
        step: 0.6, // 数值越大速度滚动越快
        limitMoveNum: 3, // 开始无缝滚动的数据量 this.dataList.length
        hoverStop: true, // 是否开启鼠标悬停stop
        direction: 1, // 0向下 1向上 2向左 3向右
        openWatch: true, // 开启数据实时监控刷新dom
        singleHeight: 33, // 单步运动停止的高度(默认值0是无缝不停止的滚动) direction => 0/1
        singleWidth: 0, // 单步运动停止的宽度(默认值0是无缝不停止的滚动) direction => 2/3
        waitTime: 1000 // 单步运动停止的时间(默认值1000ms)
      }
    },
  },
相关推荐
李姆斯2 小时前
为啥Agent在coding表现这么好,但是在别的领域就是差的不少?
前端·agent·ai编程
鱼与宇4 小时前
前端Web(html+css+js+vue3)
前端
孙克旭_5 小时前
Docker 镜像构建|Vue+SpringBoot+Go 多语言项目 Dockerfile 案例
linux·运维·vue.js·spring boot·docker·dockerfile
雪芽蓝域zzs6 小时前
(六)打包优化 + Nginx 部署完整配置 + 项目收尾
前端·vue.js
研☆香6 小时前
聊一聊前端的常见字 关键字
开发语言·前端·javascript
东风破_6 小时前
JWT 1:从一个登录请求开始,理解 React 项目里的 API 层与 Mock
前端·后端
东风破_7 小时前
JWT 3:为什么 Token 要放进 Authorization?Axios 拦截器到底解决了什么?
前端·后端
东风破_7 小时前
JWT 5:路由守卫是什么?把整个 JWT 登录鉴权流程串起来
前端·后端
东风破_7 小时前
JWT 2:HTTP 是无状态的,为什么登录成功后还要给 Token?
前端·后端
东风破_7 小时前
JWT 4:Zustand 到底解决了什么?为什么登录状态要放进 Store?
前端·后端