element-plus table 表格,切换下一页,滚动条不会置顶,
<el-table ref='table'>.....</el-table>
<el-footer>
<el-pagination background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
v-model:current-page="currentPage"
:total="totalCount"
:page-size="pageSize"
:page-sizes="[22, 30, 50, 100]"
:page-count="pageCount"
layout="total,sizes,prev, pager, next"
prev-text="上一页"
next-text="下一页"
>
</el-pagination>
</el-footer>
<scripct>
export default {
methods: {
handleCurrentChange (val) {
this.currentPage = val
this.$nextTick(() => {
console.log('##############', this.$refs.table.scrollTop)
this.$refs.table.scrollTop = 0
})
}
}
}
</script>
上面打印出来是undefined.请指点