0
0
Fork 0
mirror of https://github.com/VueTubeApp/VueTube synced 2024-11-09 13:05:07 +00:00
VueTube/NUXT/components/UtilRenderers/slimVideoDescriptionRenderer.vue

50 lines
1.1 KiB
Vue
Raw Normal View History

2022-03-27 04:31:32 +00:00
<template>
2022-03-29 02:30:20 +00:00
<div class="description">
<template v-for="(text, index) in render.descriptionBodyText.runs">
<template v-if="$rendererUtils.checkInternal(text)">
<a
@click="openInternal($rendererUtils.getNavigationEndpoints(text))"
:key="index"
>{{ text.text }}</a
>
</template>
<template
v-else-if="
text.navigationEndpoint && text.navigationEndpoint.urlEndpoint
"
>
<a
@click="openExternal($rendererUtils.getNavigationEndpoints(text))"
:key="index"
>{{ text.text }}</a
>
2022-03-27 05:48:27 +00:00
</template>
<template v-else> {{ text.text }} </template>
</template>
2022-03-27 04:31:32 +00:00
</div>
</template>
2022-03-29 02:30:20 +00:00
<style scoped>
.description {
white-space: pre-line;
margin-bottom: 16px;
margin-top: 16px;
2022-03-29 02:30:20 +00:00
}
</style>
2022-03-27 04:31:32 +00:00
<script>
import { Browser } from "@capacitor/browser";
2022-03-27 04:31:32 +00:00
export default {
props: ["render"],
methods: {
async openExternal(url) {
await Browser.open({ url: url });
},
async openInternal(url) {
await this.$router.push(url);
},
2022-03-27 04:31:32 +00:00
},
};
</script>