Feature: 页面内Markdown渲染 & 规格参数表格

This commit is contained in:
2025-08-16 13:57:17 +08:00
parent c77b2282da
commit daa91ac56f
10 changed files with 221 additions and 36 deletions

View File

@ -0,0 +1,36 @@
<!-- eslint-disable vue/no-v-html -->
<template>
<!-- v-html 渲染解析后的 HTML -->
<div class="markdown-body" v-html="safeHtml"/>
</template>
<script setup lang="ts">
interface Props {
content: string
}
const props = defineProps<Props>()
// 将 Markdown 转换成 HTML
const safeHtml = computed(() => renderMarkdown(props.content))
console.log('Markdown content:', safeHtml.value)
</script>
<style>
.markdown-body {
padding: 10px;
line-height: 1.6;
}
.markdown-body h1,
.markdown-body h2 {
color: var(--el-color-primary);
font-size: 1.5em;
margin-bottom: 0.5em;
}
.markdown-body ol {
list-style-type: decimal;
padding-left: 2em;
}
</style>