ChatContent

默认聊天格式

对大模型返回的 markdown 数据自动渲染。

This is TDesign

This is TDesign

This is TDesign

This is TDesign

The point of reference-style links is not that they’re easier to write. The point is that with reference-style links, your document source is vastly more readable. Compare the above examples: using reference-style links, the paragraph itself is only 81 characters long; with inline-style links, it’s 176 characters; and as raw HTML, it’s 234 characters. In the raw HTML, there’s more markup than there is text.

This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet.

an example | an example | an example

  1. Bird
  2. McHale
  3. Parish
    1. Bird
    2. McHale
      1. Parish
  • Red
  • Green
  • Blue
    • Red
    • Green
      • Blue

This is an example inline link.

http://example.com/

bash
复制代码
$ npm i tdesign-vue-next

javascript
复制代码
import { createApp } from 'vue'; import App from './app.vue'; const app = createApp(App); app.use(TDesignChat);

纯文本聊天

用户发送的消息保持默认格式显示,没有高亮效果

import TDesign from 'tdesign-vue-next'; // 引入tdesign组件库
app.use(TDesign).use(router).mount('#app');

ChatContent Props

名称类型默认值描述必传
contentString-聊天内容,支持 markdown 格式N
roleString-角色,不同选项配置不同的样式,支持类型包括用户、助手、错误、模型切换、系统消息。可选项:user/assistant/error/model-change/systemN