下载本地的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()~~~~
}

一统
57 声望4 粉丝