页面如下:
导出是用xlsx插件实现的,可导出后的excel显示的数据格式不对
代码:
//导出当前表格
exportCurrent:function(){
var wb = XLSX.utils.table_to_book(document.querySelector('#out-table')) //表格id
var wbout = XLSX.write(wb, { bookType: 'xlsx', bookSST: true, type: 'array' })
try {
FileSaver.saveAs(new Blob([wbout], { type: 'application/octet-stream' }), 'sheet.xlsx') //文件名
} catch (e) { if (typeof console !== 'undefined') console.log(e, wbout) }
return wbout
},
这个该怎么解决呀 找相关文档也找不到 好心酸~~
给身份证那一个td 添加
style
,例如mso-number-format:'\@';
.js导出excel表格中较长数字串会变成科学计数法问题