<template><divclass="scroll_table"><divstyle="display: inline-block;width: 100%"><el-table:data="tableList"class="table"><el-table-columnv-for="(item,index) in columns":key="index+'i'":label="item.label":prop="item.prop"/></el-table><vue-seamless-scroll:data="tableList"class="seamless-warp"style="width: 100%":class-option="classOption"><el-table:data="tableList"class="table_scroll"><el-table-columnv-for="(item,index) in columns":key="index+'i'":label="item.label":prop="item.prop"/></el-table></vue-seamless-scroll></div></div></template>
js
<script>exportdefault{name:"ScrollTable",data(){return{columns:[{prop:'name',label:'姓名',minWidth:'100',sort:true},{prop:'date',label:'日期',minWidth:'180',sort:true},{prop:'age',label:'年龄',minWidth:'180',sort:true},{prop:'status',label:'状态',minWidth:'180',sort:true},{prop:'address',label:'地址',minWidth:'220',sort:true}],tableList:[{id:'1',date:'2019-09-25',name:'张三',status:'待处理',age:18,address:'广东省广州市天河区'},{id:'2',date:'2019-09-26',name:'李四',age:19,status:'已处理',address:'广东省广州市天广东省广州市天河区2广东省广州市天河区2河区2'},{id:'3',date:'2019-09-27',name:'王五',age:20,status:'已完成',address:'广东省广州市天河区3'},{id:'3',date:'2019-09-27',name:'赵六',age:20,status:'已完成',address:'广东省广州市天河区3'}]}},computed:{classOption(){return{step:0.8,// 数值越大速度滚动越快limitMoveNum:this.tableList.length,// 开始无缝滚动的数据量 this.tableListhoverStop:true,// 是否开启鼠标悬停stopdirection:1,// 0向下 1向上 2向左 3向右openWatch:true,// 开启数据实时监控刷新domsingleHeight:0,// 单步运动停止的高度(默认值0是无缝不停止的滚动) direction => 0/1singleWidth:0,// 单步运动停止的宽度(默认值0是无缝不停止的滚动) direction => 2/3waitTime:1000// 单步运动停止的时间(默认值1000ms)}}}}</script>