feat: 新增markdown渲染
This commit is contained in:
@@ -47,7 +47,7 @@
|
||||
"radash": "^12.1.0",
|
||||
"reset-css": "^5.0.2",
|
||||
"vue": "^3.5.16",
|
||||
"vue-element-plus-x": "1.2.0",
|
||||
"vue-element-plus-x": "1.2.26-beta",
|
||||
"vue-router": "4"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
1554
Yi.Ai.Vue3/pnpm-lock.yaml
generated
1554
Yi.Ai.Vue3/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -8,6 +8,7 @@ import type { FilesCardProps } from 'vue-element-plus-x/types/FilesCard';
|
||||
import type { ThinkingStatus } from 'vue-element-plus-x/types/Thinking';
|
||||
import { ElMessage } from 'element-plus';
|
||||
import { useHookFetch } from 'hook-fetch/vue';
|
||||
import { ref } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { send } from '@/api';
|
||||
import FilesSelect from '@/components/FilesSelect/index.vue';
|
||||
@@ -81,7 +82,6 @@ watch(
|
||||
await chatStore.requestChatList(`${_id_}`);
|
||||
// 请求聊天记录后,赋值回显,并滚动到底部
|
||||
bubbleItems.value = chatStore.chatMap[`${_id_}`] as MessageItem[];
|
||||
|
||||
// 滚动到底部
|
||||
setTimeout(() => {
|
||||
bubbleListRef.value!.scrollToBottom();
|
||||
@@ -265,6 +265,11 @@ watch(
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
function markdownContent(item: any) {
|
||||
console.log('item---', item);
|
||||
return item.content;
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -277,6 +282,10 @@ watch(
|
||||
:status="item.thinkingStatus" class="thinking-chain-warp" @change="handleChange"
|
||||
/>
|
||||
</template>
|
||||
<!-- 自定义气泡内容 -->
|
||||
<template #content="{ item }">
|
||||
<XMarkdown :markdown="markdownContent(item)" />
|
||||
</template>
|
||||
</BubbleList>
|
||||
|
||||
<Sender
|
||||
|
||||
Reference in New Issue
Block a user