X-Find迅聘选才
`;
return html;
}
导出的样式js文件:
.page_layout {
position: relative;
height: 100%;
display: flex;
& .layout_content {
flex-grow: 1;
display: flex;
flex-direction: column;
}
}
...
2、导出Word
1)使用上面构造好的html文本,以文件流的形式发送到后台,后台通过转换得到word流传给前端并下载
{
console.log('download res',res);
//通过后台返回 的word文件流设置文件名并下载
var blob = new Blob([res.data],{ type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document;charset=utf-8'}); //application/vnd.openxmlformats-officedocument.wordprocessingml.document这里表示doc类型
var downloadElement = document.createElement('a');
var href = window.URL.createObjectURL(blob); //创建下载的链接
downloadElement.href = href