🐛 修复公告标题显示 <br> 的问题

This commit is contained in:
BTMuli
2023-12-09 15:39:22 +08:00
parent 527093b982
commit 5406e10922

View File

@@ -26,7 +26,9 @@
</div>
</div>
</div>
<v-card-title class="anno-title" :title="item.title">{{ item.subtitle }}</v-card-title>
<v-card-title class="anno-title" :title="item.title">{{
parseTitle(item.title)
}}</v-card-title>
<div class="anno-label" :title="`标签:${item.tagLabel}`">
<img :src="item.tagIcon" alt="tag" />
<span>{{ item.tagLabel }}</span>
@@ -89,6 +91,12 @@ onMounted(async () => {
});
});
function parseTitle(title: string): string {
const div = document.createElement("div");
div.innerHTML = title;
return div.innerText;
}
async function switchNews(): Promise<void> {
await router.push("/news/2");
}