mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-12 09:18:14 +08:00
🌱 video 缺乏数据源
This commit is contained in:
32
src/components/post/tp-video.vue
Normal file
32
src/components/post/tp-video.vue
Normal file
@@ -0,0 +1,32 @@
|
||||
<template>
|
||||
<div class="tp-video-box">
|
||||
{{ props.data }}
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref } from "vue";
|
||||
|
||||
// todo https://zhuanlan.zhihu.com/p/450632587
|
||||
interface TpVideo {
|
||||
insert: {
|
||||
video: string;
|
||||
};
|
||||
}
|
||||
|
||||
interface TpVideoProps {
|
||||
data: TpVideo;
|
||||
}
|
||||
|
||||
const props = defineProps<TpVideoProps>();
|
||||
const videoAspectRatio = ref<number>(16 / 9);
|
||||
|
||||
console.log("tpVideo", props.data.insert.video);
|
||||
</script>
|
||||
<style lang="css" scoped>
|
||||
.tp-video-box {
|
||||
position: relative;
|
||||
max-width: 100%;
|
||||
margin: 10px auto;
|
||||
aspect-ratio: v-bind(videoAspectRatio);
|
||||
}
|
||||
</style>
|
||||
@@ -14,8 +14,18 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<TpVideo :data="mock" />
|
||||
</template>
|
||||
<script lang="ts" setup></script>
|
||||
<script lang="ts" setup>
|
||||
import TpVideo from "../../components/post/tp-video.vue";
|
||||
|
||||
const mock = {
|
||||
insert: {
|
||||
// todo:数据也可能是 BV1qb4y1L7mD,缺乏数据来源
|
||||
video: "https://www.bilibili.com/video/BV1qb4y1L7mD",
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="css" scoped>
|
||||
.test-box {
|
||||
display: flex;
|
||||
|
||||
15
src/plugins/Mys/types/SctPost.d.ts
vendored
15
src/plugins/Mys/types/SctPost.d.ts
vendored
@@ -47,20 +47,7 @@ declare namespace TGApp.Plugins.Mys.SctPost {
|
||||
interface Other {
|
||||
describe: string;
|
||||
imgs: string[];
|
||||
|
||||
[key: string]: unknown;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 帖子结构化数据-视频类型-站外视频
|
||||
* @since Beta v0.3.4
|
||||
* @interface Video
|
||||
* @extends Base
|
||||
* @property {string} insert.video - 视频链接
|
||||
* @return Video
|
||||
*/
|
||||
interface Video extends Base {
|
||||
insert: {
|
||||
video: string;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user