|
|
@ -15,6 +15,8 @@ const { |
|
|
|
item: { 'Published Time': CreatedAt, Description, Title, Tags }, |
|
|
|
item: { 'Published Time': CreatedAt, Description, Title, Tags }, |
|
|
|
} = props |
|
|
|
} = props |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const truncate = ref(true) |
|
|
|
|
|
|
|
|
|
|
|
const iconColorMap = { |
|
|
|
const iconColorMap = { |
|
|
|
'Hotfix': { |
|
|
|
'Hotfix': { |
|
|
|
icon: iconMap.ncTool, |
|
|
|
icon: iconMap.ncTool, |
|
|
@ -43,16 +45,16 @@ const renderMarkdown = async (markdown: string) => { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const renderedText = computedAsync(async () => { |
|
|
|
const renderedText = computedAsync(async () => { |
|
|
|
return await renderMarkdown(Description) |
|
|
|
return await renderMarkdown(truncate.value ? Description.substring(0, 300).concat('...') : Description) |
|
|
|
}) |
|
|
|
}) |
|
|
|
</script> |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div class="block px-12 relative"> |
|
|
|
<div class="block relative"> |
|
|
|
<div class="relative pb-12"> |
|
|
|
<div class="relative bg-white"> |
|
|
|
<div class="aside"> |
|
|
|
<div class="aside"> |
|
|
|
<div class="aside-divider"> |
|
|
|
<div class="aside-divider"> |
|
|
|
<div class="aside-divider-dot"></div> |
|
|
|
<div class="aside-divider-dot mt-8"></div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="aside-inner"> |
|
|
|
<div class="aside-inner"> |
|
|
|
<div class="text-sm text-right pr-8 text-gray-700 leading-5"> |
|
|
|
<div class="text-sm text-right pr-8 text-gray-700 leading-5"> |
|
|
@ -62,7 +64,7 @@ const renderedText = computedAsync(async () => { |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div class="content"> |
|
|
|
<div class="content"> |
|
|
|
<div class="flex flex-col py-6 gap-5"> |
|
|
|
<div class="pt-6 pr-6 space-y-5"> |
|
|
|
<div class="flex items-center"> |
|
|
|
<div class="flex items-center"> |
|
|
|
<a |
|
|
|
<a |
|
|
|
v-for="tag in tags" |
|
|
|
v-for="tag in tags" |
|
|
@ -106,6 +108,13 @@ const renderedText = computedAsync(async () => { |
|
|
|
{{ Title }} |
|
|
|
{{ Title }} |
|
|
|
</NcBadge> |
|
|
|
</NcBadge> |
|
|
|
<div class="prose max-w-none" v-html="renderedText"></div> |
|
|
|
<div class="prose max-w-none" v-html="renderedText"></div> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<NcButton v-if="truncate" size="small" class="w-29" type="text" @click="truncate = false"> |
|
|
|
|
|
|
|
<div class="gap-2 flex items-center"> |
|
|
|
|
|
|
|
Show more |
|
|
|
|
|
|
|
<GeneralIcon icon="arrowDown" /> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</NcButton> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -119,7 +128,7 @@ const renderedText = computedAsync(async () => { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.content { |
|
|
|
.content { |
|
|
|
@apply !pl-50; |
|
|
|
@apply !pl-52; |
|
|
|
|
|
|
|
|
|
|
|
a { |
|
|
|
a { |
|
|
|
@apply !no-underline; |
|
|
|
@apply !no-underline; |
|
|
@ -133,29 +142,33 @@ const renderedText = computedAsync(async () => { |
|
|
|
h1 { |
|
|
|
h1 { |
|
|
|
@apply !text-3xl !font-bold; |
|
|
|
@apply !text-3xl !font-bold; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
p { |
|
|
|
|
|
|
|
@apply leading-5; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.aside { |
|
|
|
.aside { |
|
|
|
@apply absolute left-0 top-1 bottom-2 w-44; |
|
|
|
@apply absolute left-0 top-0 bottom-0 w-52; |
|
|
|
|
|
|
|
|
|
|
|
.aside-inner { |
|
|
|
.aside-inner { |
|
|
|
@apply sticky top-6; |
|
|
|
@apply sticky top-0 pt-5; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.aside-divider { |
|
|
|
.aside-divider { |
|
|
|
@apply absolute top-0 right-0 bottom-0 w-1.5; |
|
|
|
@apply absolute top-0 right-0 bottom-0 w-1.5 mr-3; |
|
|
|
&:before { |
|
|
|
&:before { |
|
|
|
@apply absolute bg-[#E7E7E9] left-0 transform -translate-x-1/2; |
|
|
|
@apply absolute bg-[#E7E7E9] left-0 transform -translate-x-1/2; |
|
|
|
content: ''; |
|
|
|
content: ''; |
|
|
|
top: 6px; |
|
|
|
top: 0px; |
|
|
|
bottom: 0px; |
|
|
|
bottom: 0px; |
|
|
|
width: 2px; |
|
|
|
width: 2px; |
|
|
|
border-radius: 2px; |
|
|
|
border-radius: 2px; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.aside-divider-dot { |
|
|
|
.aside-divider-dot { |
|
|
|
@apply sticky h-5 top-7.5 |
|
|
|
@apply sticky h-5 mr-3 top-9; |
|
|
|
transform: translateY(calc(-50% + 3px)) translateX(50%); |
|
|
|
transform: translateY(calc(-50% + 3px)) translateX(50%); |
|
|
|
&:before { |
|
|
|
&:before { |
|
|
|
@apply bg-brand-500 absolute w-2 h-2 border-2 border-white left-0 rounded-full transform -translate-x-1/2; |
|
|
|
@apply bg-brand-500 absolute w-2 h-2 border-2 border-white left-0 rounded-full transform -translate-x-1/2; |
|
|
|