<el-table ref="table" :data="tableData" :header-cell-style="{background: '#F0F2F7', color: '#606266'}" @cell-mouse-enter="mouseEnter" @cell-mouse-leave="mouseLeave" @row-click="handRowClick" > <el-table-column align="center" type="index" width="50" label="序号" > </el-table-column> <el-table-column align="center" prop="metadataName" label="元数据名称" show-overflow-tooltip > </el-table-column> <el-table-column align="center" prop="metadataCode" label="元数据代码" show-overflow-tooltip > </el-table-column> <el-table-column align="center" prop="createTime" label="发布时间" width="140" > </el-table-column> </el-table>
// table自动滚动 handScroll() { const table = this.$refs.table const divData = table.bodyWrapper this.tableInterval = setInterval(() => { divData.scrollTop += 3 if (divData.clientHeight + divData.scrollTop == divData.scrollHeight) { divData.scrollTop = 0 } }, 200) }, //鼠标移入 mouseEnter() { clearInterval(this.tableInterval) this.tableInterval = null }, //鼠标移出 mouseLeave() { this.handScroll() },