feat: pdf components
This commit is contained in:
6
.vitepress/cache/deps/_metadata.json
vendored
6
.vitepress/cache/deps/_metadata.json
vendored
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"hash": "7ffd30ca",
|
"hash": "37427fdc",
|
||||||
"browserHash": "44dc6d18",
|
"browserHash": "93d17c76",
|
||||||
"optimized": {
|
"optimized": {
|
||||||
"vue": {
|
"vue": {
|
||||||
"src": "../../../node_modules/vue/dist/vue.runtime.esm-bundler.js",
|
"src": "../../../node_modules/vue/dist/vue.runtime.esm-bundler.js",
|
||||||
"file": "vue.js",
|
"file": "vue.js",
|
||||||
"fileHash": "0714df1d",
|
"fileHash": "87e80f21",
|
||||||
"needsInterop": false
|
"needsInterop": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
39
components/pdf.vue
Normal file
39
components/pdf.vue
Normal 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>
|
||||||
Reference in New Issue
Block a user