// docx 文件下载 如需xlsx格式文件 换掉后缀即可
useExportWithAxios: (url, params, file) => {
// url 接口路径
// params 后端需要的参数
// file 自定义文件名称
axios.post(url, params,
{
responseType: 'blob',
}).then((res) => {
const blob = res.data;
const reader = new FileReader();
reader.readAsDataURL(blob);
reader.onload = (e) => {
if (file.indexOf('.') == -1) file = `${file}.docx`;
if (navigator.msSaveOrOpenBlob) {
navigator.msSaveOrOpenBlob(blob, `${file}`);
} else {
const a = document.createElement('a');<