feat: 将Solution的内容渲染有Markdown改为Html

This commit is contained in:
2025-11-14 09:54:41 +08:00
parent f4f7e490b4
commit 100b79f99b
2 changed files with 12 additions and 2 deletions

View File

@ -11,7 +11,11 @@
<p class="solution-summary">{{ solution.summary }}</p> <p class="solution-summary">{{ solution.summary }}</p>
</header> </header>
<section class="solution-content"> <section class="solution-content">
<markdown-renderer :content="solution?.content || ''" /> <!-- eslint-disable-next-line vue/no-v-html -->
<div v-if="!hydrated" v-html="solution?.content || ''" />
<div v-else>
<HtmlRenderer class="html-typography" :html="solution.content || ''" />
</div>
</section> </section>
</article> </article>
</template> </template>
@ -23,6 +27,12 @@
default: null, default: null,
}, },
}); });
const hydrated = ref(false);
onMounted(() => {
hydrated.value = true;
});
</script> </script>
<style scoped> <style scoped>

View File

@ -8,7 +8,7 @@
:title="question.title" :title="question.title"
:name="question.id" :name="question.id"
> >
<!-- <markdown-renderer :content="question.content || ''" /> --> <!-- eslint-disable-next-line vue/no-v-html -->
<div v-if="!hydrated" v-html="question.content" /> <div v-if="!hydrated" v-html="question.content" />
<div v-else> <div v-else>
<HtmlRenderer <HtmlRenderer