.xlsx file to be placed in static directory
<button id="hf" href="#" download @click="downfile">导入模板下载</button>
In the methods write a method to ok
// 下载文件
downfile(urls) {
urls = location.origin + '/static/userImport.xlsx'
var elemIF = document.createElement('iframe')
elemIF.src = urls
elemIF.style.display = 'none'
document.body.appendChild(elemIF)
}
Thank big brother pointing