要实现在 element-ui 中固定表头并滚动到底部加载更多数据,需要使用 el-table 组件中的 "body-style" 属性和 "scroll" 属性。
使用 "body-style" 属性设置表格内容的高度和 overflow 属性。例如:
<el-table :data="tableData" body-style="height: 200px;overflow-y: auto;">
使用 "scroll" 属性设置表格滚动的宽度和高度。例如:
<el-table:data="tableData" :body-style="{height: '200px',overflow: 'auto'}" :scroll="{y: '200px'}"