静态文件
<a href="doc/use_document.pdf" download="使用文档.pdf"><Button type="primary" icon="ios-download-outline" style="margin-right:10px;float:left">获取使用文档</Button></a>
对于静态文件,可以放在项目中直接访问
但需要注意的是,只能访问到resources/static文件下的文件。如果放在其他文件夹下则访问不到。例子中文件的位置为/resources/static/doc/use_document.pdf
动态文件
对于动态文件,此处使用文件流进行传输
前端
<a herf="#" @click="getDescription" style="font-size:14px" download="使用文档.pdf"><Button type="primary" icon="ios-download-outline">获取使用文档</Button>