生命周期中使用
//生命周期
mounted(){
this.$nextTick(()=>{
this.showSummariesPosition();
})
}
方法
//方法
showSummariesPosition(){
let table = document.querySelector('.el-table');
let footer = document.querySelector('.el-table__footer-wrapper');
let body = document.querySelector('.el-table__body-wrapper');
table.removeChild(footer);
table.insertBefore(footer,body);
}
在Vue应用的mounted生命周期钩子中,使用$nextTick方法确保DOM更新后,执行showSummariesPosition方法。该方法通过查询DOM,找到.el-table、.el-table__footer-wrapper和.el-table__body-wrapper元素,然后重新排列它们的位置,将footer插入到body前面。
1684

被折叠的 条评论
为什么被折叠?



