feat: 首页评论修复html样式

This commit is contained in:
caiyuchao
2025-09-11 17:11:40 +08:00
parent 85b3b2d471
commit 8c5c7dde57
2 changed files with 11 additions and 5 deletions

View File

@@ -93,11 +93,14 @@ onMounted(async () => {
if (dataContent) {
const position = dataContent.indexOf('>') + 1;
const originalString = dataContent;
const stringToInsert = `<span style="font-size: 12px; color: #32363973">${item.author}</span>`;
const stringToInsert = `<span style="font-size: 14px; color: #32363973">${item.author}</span>`;
dataContent =
originalString.slice(0, position) +
originalString.startsWith('<p>') || originalString.startsWith('<h')
? originalString.slice(0, position) +
stringToInsert +
originalString.slice(position);
originalString.slice(position)
: stringToInsert + originalString;
}
return {

View File

@@ -119,7 +119,10 @@ withDefaults(defineProps<Props>(), {
</a-row> -->
</p>
<!-- eslint-disable vue/no-v-html -->
<p class="*:text-primary" v-html="item.content"></p>
<p
class="rich-text-comment-content-table"
v-html="item.content"
></p>
</div>
</div>
<div class="hidden h-full shrink-0 sm:flex sm:flex-col sm:items-end">