mirror of
https://github.com/VueTubeApp/VueTube
synced 2024-11-25 20:55:17 +00:00
db92f4d595
Remove @capacitor/browser dependancy from the app, extra space that can be accomplished now with `this.$vuetube.openexternal(url)`
62 lines
1.4 KiB
Vue
62 lines
1.4 KiB
Vue
<template>
|
|
<div class="yt-text-formatter">
|
|
<template v-for="(text, index) in textRuns">
|
|
<template v-if="$rendererUtils.checkInternal(text)">
|
|
<a
|
|
@click.stop.prevent="
|
|
openInternal($rendererUtils.getNavigationEndpoints(text))
|
|
"
|
|
:key="index"
|
|
>{{ text.text }}</a
|
|
>
|
|
</template>
|
|
<template
|
|
v-else-if="
|
|
text.navigationEndpoint && text.navigationEndpoint.urlEndpoint
|
|
"
|
|
>
|
|
<a
|
|
@click.stop.prevent="
|
|
openExternal($rendererUtils.getNavigationEndpoints(text))
|
|
"
|
|
:key="index"
|
|
>{{ text.text }}</a
|
|
>
|
|
</template>
|
|
<template v-else-if="text.emoji && text.emoji.isCustomEmoji">
|
|
<img
|
|
:src="
|
|
text.emoji.image.thumbnails[text.emoji.image.thumbnails.length - 1]
|
|
.url
|
|
"
|
|
:alt="text.text"
|
|
:key="index"
|
|
class="emoji"
|
|
draggable="false"
|
|
/>
|
|
</template>
|
|
<template v-else>
|
|
<span :key="index" v-emoji>{{ text.text }}</span>
|
|
</template>
|
|
</template>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
props: {
|
|
textRuns: {
|
|
type: Array,
|
|
default: () => [],
|
|
},
|
|
},
|
|
methods: {
|
|
openExternal(url) {
|
|
this.$vuetube.openExternal(url);
|
|
},
|
|
async openInternal(url) {
|
|
await this.$router.push(url);
|
|
},
|
|
},
|
|
};
|
|
</script>
|