const exort = async () => {
try {
const { data } = await zhjxDownloadFile({
meta: {
user_token: localStorage.getItem('user_token'),
file_name: activeName.value,
image_indexs: activePage.value,
},
});
let uri = 'data:text/csv;base64,' + data.csv;
const a = document.createElement('a');
a.download = `${activeName.value.replace('.pdf', '')}-page${activePage.value}.csv`;
a.href = uri;
a.click();
ElMessage.success('导出成功');
} catch (error) {}
};
标签:activeName,JavasSript,const,base64,value,csv,data
From: https://www.cnblogs.com/wx980416/p/17381282.html