feat: 将Solution的内容渲染有Markdown改为Html
This commit is contained in:
@ -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>
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user