Vue 下载本地静态资源
文章目录
下载本地的exe,我们要把需要下载的静态资源放在static文件夹下
<a href="/static/codebase/WebComponentsKit.exe" download="WebComponentsKit.exe" target="_blank">测试</a>
模拟a标签方法
<el-button @click="download">test</el-button>
downloadClick(row) {
var a = document.createElement('a')
a.setAttribute('href', "/static/codebase/WebComponentsKit.exe")
a.setAttribute('download' ,"WebComponentsKit.exe")
document.body.appendChild(a)
a.click()~~~~
}
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论