🌱 video 缺乏数据源

This commit is contained in:
BTMuli
2023-12-08 13:28:23 +08:00
parent e61f9519db
commit 9aac81cbc4
3 changed files with 44 additions and 15 deletions

View 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>

View File

@@ -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;

View File

@@ -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;
};
}
}