Files
fzu-product/components/pdf.vue
2023-08-14 23:27:19 +08:00

40 lines
551 B
Vue

<template>
<div class="pdf">
<button @click="open">打开PDF</button>
</div>
</template>
<script setup>
import { defineProps } from "vue";
const url = defineProps({
url: {
type: String,
default: "",
},
});
const open = () => {
window.open(url.url);
};
</script>
<style scoped>
button {
width: 100px;
height: 40px;
background-color: #409eff;
color: #fff;
border: none;
border-radius: 4px;
cursor: pointer;
}
.button:hover {
background-color: #66b1ff;
}
.pdf {
display: block;
margin: 1rem auto;
}
</style>