组件/Chat 消息列表
通用组件

Chat 消息列表

常见 AI 消息列表(支持 markdown、图片缩略图、消息依次进入)。

该页面由 AI 迁移生成,请谨慎使用

内容已迁移完成,但仍建议结合源码和人工评审结果使用。

Chat 消息列表

常见 AI 消息列表(支持 markdown、图片缩略图、消息依次进入)。

import { ref } from 'vue' const messages = ref([ { id: 'm1', role: 'system', content: 'System message', createdAt: Date.now() - 60_000, }, { id: 'm2', role: 'user', content: 'Show me **markdown** and an image.', createdAt: Date.now() - 30_000, attachments: [ { type: 'image', url: 'https://picsum.photos/seed/tuffex/420/280', name: 'demo' }, ], }, { id: 'm3', role: 'assistant', content: 'Here is some code:\n\n```ts\nexport const hello = 1\n```', createdAt: Date.now() - 10_000, }, ])

基础用法

ChatList

示例即将加载...
<template>
  <TxChatList :messages="messages" :markdown="true" :stagger="true" />
</template>