【代码优化】AI:markdown 组件,增加相关的注释

pull/491/MERGE
YunaiV 2024-07-29 21:24:03 +08:00
parent cb02377706
commit a805ceb534
4 changed files with 1223 additions and 1957 deletions

View File

@ -27,6 +27,9 @@ const include = [
'echarts-wordcloud',
'@wangeditor/editor',
'@wangeditor/editor-for-vue',
'@microsoft/fetch-event-source',
'markdown-it',
'highlight.js',
'element-plus',
'element-plus/es',
'element-plus/es/locale/lang/zh-cn',
@ -104,7 +107,11 @@ const include = [
'element-plus/es/components/collapse/style/css',
'element-plus/es/components/collapse-item/style/css',
'element-plus/es/components/button-group/style/css',
'element-plus/es/components/text/style/css'
'element-plus/es/components/text/style/css',
'element-plus/es/components/segmented/style/css',
'@element-plus/icons-vue',
'element-plus/es/components/footer/style/css',
'element-plus/es/components/empty/style/css'
]
const exclude = ['@iconify/json']

File diff suppressed because it is too large Load Diff

View File

@ -1,10 +1,9 @@
<template>
<!-- <div ref="contentRef" class="markdown-view" v-html="contentHtml"></div>-->
<div ref="contentRef" class="markdown-view" v-html="renderedMarkdown"></div>
</template>
<script setup lang="ts">
import {useClipboard} from '@vueuse/core'
import { useClipboard } from '@vueuse/core'
import MarkdownIt from 'markdown-it'
import 'highlight.js/styles/vs2015.min.css'
import hljs from 'highlight.js'
@ -20,7 +19,6 @@ const props = defineProps({
const message = useMessage() //
const { copy } = useClipboard() // copy
const contentRef = ref()
const { content } = toRefs(props) // props
const md = new MarkdownIt({
highlight: function (str, lang) {
@ -32,11 +30,12 @@ const md = new MarkdownIt({
}
return ``
}
});
})
/** 渲染 markdown */
const renderedMarkdown = computed(() => {
return md.render(props.content);
});
return md.render(props.content)
})
/** 初始化 **/
onMounted(async () => {

View File

@ -4,10 +4,10 @@
<ConversationList
:active-id="activeConversationId"
ref="conversationListRef"
@onConversationCreate="handleConversationCreateSuccess"
@onConversationClick="handleConversationClick"
@onConversationClear="handleConversationClear"
@onConversationDelete="handlerConversationDelete"
@on-conversation-create="handleConversationCreateSuccess"
@on-conversation-click="handleConversationClick"
@on-conversation-clear="handleConversationClear"
@on-conversation-delete="handlerConversationDelete"
/>
<!-- 右侧对话详情 -->
<el-container class="detail-container">