feat: pdf components

This commit is contained in:
camera-2018
2023-04-18 14:31:29 +08:00
parent 894efa845e
commit 27990c9868
2 changed files with 42 additions and 3 deletions

39
components/pdf.vue Normal file
View File

@@ -0,0 +1,39 @@
<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>