目录
1.最简单的静态资源下载方式
downloadStaticFile() {
try {
const link = document.createElement('a');
link.href = '/static/模版文件.xlsx';
link.download = '模版文件.xlsx';
link.style.display = 'none';
document.body.appendChild(link);
link.click();
// 10秒后删除链接
setTimeout(() => {
document.body.removeChild(link);
}, 10000);
} catch (error) {
console.error('下载失败:', error);
}
},
订阅专栏 解锁全文
 -- 网站页面上静态资源下载&spm=1001.2101.3001.5002&articleId=155051883&d=1&t=3&u=fd1958224e0c461f9cc99ab0ff01b53a)
680

被折叠的 条评论
为什么被折叠?



