feat: 将Markdown渲染改为HTML渲染

- CMS相关字段由Markdown改为WYSIWYG,前端做出对应更改
- AssetUrl重写:将CMS地址重写为本地API
This commit is contained in:
2025-11-14 11:06:00 +08:00
parent 644dfa329c
commit 54d0e297ea
14 changed files with 143 additions and 18 deletions

View File

@ -2,7 +2,14 @@
<div class="product-detail">
<el-tabs v-model="activeName" class="product-tabs" stretch>
<el-tab-pane :label="$t('product-tab.details')" name="details">
<markdown-renderer :content="product.description || ''" />
<!-- eslint-disable-next-line vue/no-v-html -->
<div v-if="!hydrated" v-html="product.description || ''" />
<div v-else>
<html-renderer
class="html-typography"
:html="product.description || ''"
/>
</div>
</el-tab-pane>
<el-tab-pane :label="$t('product-tab.specs')" name="specs">
<spec-table :data="product.specs" />
@ -25,7 +32,13 @@
},
});
const hydrated = ref(false);
const activeName = ref('details'); // 默认选中概览标签
onMounted(() => {
hydrated.value = true;
});
</script>
<style scoped>

View File

@ -8,7 +8,7 @@
<!-- 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 || ''" />
<html-renderer class="html-typography" :html="solution.content || ''" />
</div>
</section>
</article>

View File

@ -11,7 +11,7 @@
<!-- eslint-disable-next-line vue/no-v-html -->
<div v-if="!hydrated" v-html="question.content" />
<div v-else>
<HtmlRenderer
<html-renderer
class="html-typography"
:html="question.content || ''"
/>