样式优化,markdown优化

This commit is contained in:
2025-08-22 17:14:38 +08:00
parent a1537e3f9f
commit b3d63e4181
11 changed files with 163 additions and 36 deletions

View File

@@ -0,0 +1,17 @@
<template>
<div class="markdown-renderer" v-html="html"></div>
</template>
<script setup lang="ts">
import { computed } from 'vue';
import { renderMarkdown } from '@/utils/markdown';
const props = defineProps<{ content?: string }>();
const html = computed(() => renderMarkdown(props.content ?? ''));
</script>
<style scoped>
.markdown-renderer { color: var(--text-color); line-height:1.6; word-break:break-word; }
.markdown-renderer pre { background:var(--code-bg,#0b1220); color:var(--code-color,#e6edf3); padding:12px; border-radius:8px; overflow:auto; }
.markdown-renderer code { background:rgba(0,0,0,0.04); padding:2px 6px; border-radius:4px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", "Noto Mono", monospace; }
</style>