样式优化,markdown优化
This commit is contained in:
17
frontend/src/components/MarkdownRenderer.vue
Normal file
17
frontend/src/components/MarkdownRenderer.vue
Normal 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>
|
Reference in New Issue
Block a user