【代码优化】AI:markdown 组件,增加相关的注释
parent
cb02377706
commit
a805ceb534
|
@ -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']
|
||||
|
|
3152
pnpm-lock.yaml
3152
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
|
@ -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 () => {
|
||||
|
|
|
@ -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">
|
||||
|
|
Loading…
Reference in New Issue