vue导出表格数据重复
后台系统使用 vue + elementUI + xlsx 实现导出表格功能,但发现导出数据重复的问题问题所在:element 实现el-table-column fixed会重复渲染一个table。// 解决原理先移除再append进去var fix = document.querySelector('.el-table__fixed');var wb;if (fix) {w...
·
后台系统使用 vue + elementUI + xlsx 实现导出表格功能,但发现导出数据重复的问题
问题所在:element 实现el-table-column fixed会重复渲染一个table。
粗暴解决直接去掉fixed的table列 ,或
// 解决原理先移除再append进去
var fix = document.querySelector('.el-table__fixed');
var wb;
if (fix) {
wb = XLSX.utils.table_to_book(document.querySelector(id).removeChild(fix));
document.querySelector(id).appendChild(fix);
} else {
wb = XLSX.utils.table_to_book(document.querySelector(id));
}
注明来源: www.inmwang.com/detail/5
更多推荐
已为社区贡献5条内容
所有评论(0)