组件
AI 消息 AI Message
AI 消息:区分发言方。用户消息显示在内凹气泡中,助手消息直接平铺在纸面上。
#基础用法
Draft a short note announcing the ink release.
The draft is ready — three sections, one summary.
<script setup lang="ts">
import { AiContent, AiMessage } from "@bysages/vue";
</script>
<template>
<!-- Whose stroke this is: the user's words in a recessed bubble, the
assistant speaking flat on the paper. -->
<div class="grid gap-4 w-full">
<AiMessage role="user">
<AiContent>Draft a short note announcing the ink release.</AiContent>
</AiMessage>
<AiMessage role="assistant">
<AiContent>The draft is ready — three sections, one summary.</AiContent>
</AiMessage>
</div>
</template>
#属性
#AiMessage
AI 消息:区分发言方。用户消息显示在内凹气泡中,助手消息直接平铺在纸面上。
| 属性 | 类型 | 默认值 | 描述 |
|---|---|---|---|
role | String as PropType<"user" | "assistant" | "system"> | "assistant" | AI 消息:区分发言方。用户消息显示在内凹气泡中,助手消息直接平铺在纸面上。 |