1.静态文件
<template>
<img alt="Vue logo" src="./assets/logo.png">
<button v-on:click="testButton">pdf2.pdf</button>
</template>
<script>
export default {
name: 'App',
methods:{
testButton(){
console.log("./public/pdf2.pdf");
window.open("/pdf2.pdf");
},
}
}
</script>
<style>
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
}
</style>