feat: 首页评论修复html样式
This commit is contained in:
@@ -93,11 +93,14 @@ onMounted(async () => {
|
|||||||
if (dataContent) {
|
if (dataContent) {
|
||||||
const position = dataContent.indexOf('>') + 1;
|
const position = dataContent.indexOf('>') + 1;
|
||||||
const originalString = dataContent;
|
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 =
|
dataContent =
|
||||||
originalString.slice(0, position) +
|
originalString.startsWith('<p>') || originalString.startsWith('<h')
|
||||||
|
? originalString.slice(0, position) +
|
||||||
stringToInsert +
|
stringToInsert +
|
||||||
originalString.slice(position);
|
originalString.slice(position)
|
||||||
|
: stringToInsert + originalString;
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -119,7 +119,10 @@ withDefaults(defineProps<Props>(), {
|
|||||||
</a-row> -->
|
</a-row> -->
|
||||||
</p>
|
</p>
|
||||||
<!-- eslint-disable vue/no-v-html -->
|
<!-- 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>
|
</div>
|
||||||
<div class="hidden h-full shrink-0 sm:flex sm:flex-col sm:items-end">
|
<div class="hidden h-full shrink-0 sm:flex sm:flex-col sm:items-end">
|
||||||
|
|||||||
Reference in New Issue
Block a user