axios
第一步
打开已经创建好的vue文件cmd 输入 npm install js-file-download
第二步
注册一下组件
import fileDownload from 'js-file-download'
axios.get(`/operation/ruleImport/template`, {
responseType: 'blob' //返回的数据类型
})
.then(res => {
fileDownload(res.data, this.fileName)//this.fileName你的文件名带后缀
})
vue x安装
第一步通过cmd安装 :https://unpkg.com/vuex
第二步
使用npm安装:
npm install vuex --save
或者
使用Yarn安装:
yarn add vuex
也可以通过vue ui来安装