下載本地的exe,咱們要把須要下載的靜態資源放在static文件夾下app
<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()~~~~ }