update vitepress to v1.0
This commit is contained in:
37
.vitepress/theme/components/BVideo.vue
Normal file
37
.vitepress/theme/components/BVideo.vue
Normal file
@@ -0,0 +1,37 @@
|
||||
<template>
|
||||
<div class="video">
|
||||
<iframe :src="url"></iframe>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { computed } from "vue"
|
||||
interface Props {
|
||||
src: string
|
||||
p?: number
|
||||
}
|
||||
|
||||
const props = defineProps<Props>()
|
||||
const url = computed(() => {
|
||||
let url = `https://player.bilibili.com/player.html?bvid=${props.src}`
|
||||
if (props.p) {
|
||||
url += `&page=${props.p}`
|
||||
}
|
||||
return url
|
||||
})
|
||||
</script>
|
||||
<style scoped>
|
||||
.video {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
padding-bottom: calc(56.25% + 68px);
|
||||
}
|
||||
|
||||
.video > iframe {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: none;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user