a标签下载文件,用download,并改变文件名
a标签下载文件
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- import CSS -->
<link rel="stylesheet" href="https://sv-source.zt-express.com/gongdan/css/element-2.3.9.min.css">
</head>
<body>
<div id="app">
<a :href="g" :download="w3logo">
<img border="0" src="./w3school_logo_white.gif" alt="W3School">
</a>
</div>
</body>
<!-- import Vue before Element -->
<!-- <script src="https://unpkg.com/vue/dist/vue.js"></script> -->
<script src="https://sv-source.zt-express.com/gongdan/js/vue.js"></script>
<script src="https://sv-source.zt-express.com/gongdan/js/element-2.3.9.min.js"></script>
<!-- import JavaScript -->
<script>
// console.log(new Date())
new Vue({
el: '#app',
data() {
return {
w3logo:"nn",
g:"./w3school_logo_white.gif",
}
}
})
</script>
</html>
第二种方法
window.open(HostName + '/statisticalData/exportCenterData?' + data, '_blank')