a標(biāo)簽下載文件,用download,并改變文件名
a標(biāo)簽下載文件
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- import CSS -->
<link rel="stylesheet" >
</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')