<el-table :data="DrugList" ref="editTable"></el-table>
DrugList是表格的数据,监听这个数据的变化。让scrollTop=scrollHeight就可以了
watch: {
DrugList() {
this.$nextTick(() => {
if(this.$refs.editTable){
console.log(5821,this.$refs.editTable.bodyWrapper.scrollHeight)
this.$refs.editTable.bodyWrapper.scrollTop =
this.$refs.editTable.bodyWrapper.scrollHeight;
}
});
},
}