2022-03-27 04:31:32 +00:00
|
|
|
<template>
|
|
|
|
<div class="description">
|
|
|
|
<div v-for="(text, index) in render.description.runs" :key="index">
|
|
|
|
<component
|
|
|
|
:is="text.navigationEndpoint ? 'a' : 'span'"
|
2022-03-27 04:49:12 +00:00
|
|
|
:href="parseLinks(text)"
|
2022-03-27 04:31:32 +00:00
|
|
|
>{{ text.text }}
|
|
|
|
</component>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<style scoped></style>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
props: ["render"],
|
|
|
|
|
|
|
|
methods: {
|
2022-03-27 04:49:12 +00:00
|
|
|
parseLinks(base) {
|
|
|
|
const navEndpoint = base.navigationEndpoint;
|
2022-03-27 04:31:32 +00:00
|
|
|
if (!navEndpoint) return;
|
2022-03-27 04:49:12 +00:00
|
|
|
if (navEndpoint.webviewEndpoint) {
|
|
|
|
return base.text;
|
2022-03-27 04:31:32 +00:00
|
|
|
} else if (navEndpoint.browseEndpoint) {
|
|
|
|
return navEndpoint.browseEndpoint.canonicalBaseUrl;
|
|
|
|
} else if (navEndpoint.navigationEndpoint) {
|
|
|
|
return; //for now
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|