问题描述直接上图。
首先在table表格加上ref,让后在页面mounted调用 table的doLayout方法。
mounted() {
//请求列表数据
this.getdata()
window.onresize = () => {
return (() => {
this.$nextTick(() => {
//判断是否存在再执行方法,否在控制台会报错
if (this.$refs.Dorefresh && this.$refs.Dorefresh.doLayout) {
this.$refs.Dorefresh.doLayout();
}
})
})()
}
},