暂存
原创
©著作权归作者所有:来自51CTO博客作者wx5b04e97300ec7的原创作品,请联系作者获取转载授权,否则将追究法律责任
axios请求后端数据
this.$axios({
url: 'http://119.29.140.134/api/city',
method: 'post',
headers: {
'Content-Type': 'application/json'
}
})
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
});
数据导出
this.$api.getPSQAddressInfo().then(res => {
var FileSaver = require('file-saver');
var content = JSON.stringify(res.data);
var blob = new Blob([content ], {type: "text/plain;charset=utf-8"});
FileSaver.saveAs(blob, "address.json");
})