参考
AI 提示输入 AI Prompt Input
AI 输入框:复用共享 field textarea,状态机的 autoresize 让高度自动增长,发送按钮位于最后一行。主体周围的插槽对应输入区结构:`header` 放上方附件,`leading` 放文本左侧工具,`trailing` 放按钮本身,`footer` 放文本下方工具,`footer-end` 放 footer 行末尾的控件;发送按钮默认落在 `footer-end`,因此加入模型选择器后会与发送按钮同排。插槽为空时不渲染对应部件,空白输入框仍保持一行。组件受控:绑定 `v-model`,在 `submit` 时获取文本。Enter 发送,Shift+Enter 换行。`busy` 时发送按钮变为停止按钮,Enter 暂不生效。
Actions · Attachment · Attachments · CodeBody · CodeCopy · Content · Conversation · Loader · Message · Prompt · PromptEnd · PromptFooter · PromptHeader · PromptLeading · PromptMain · PromptTrailing · ReasoningContent · Response · Root · Source · Sources · Textarea · ToolBody · ToolLabel · ToolStatus · Trigger
#AiPromptInput
AI 输入框:复用共享 field textarea,状态机的 autoresize 让高度自动增长,发送按钮位于最后一行。主体周围的插槽对应输入区结构:header 放上方附件,leading 放文本左侧工具,trailing 放按钮本身,footer 放文本下方工具,footer-end 放 footer 行末尾的控件;发送按钮默认落在 footer-end,因此加入模型选择器后会与发送按钮同排。插槽为空时不渲染对应部件,空白输入框仍保持一行。组件受控:绑定 v-model,在 submit 时获取文本。Enter 发送,Shift+Enter 换行。busy 时发送按钮变为停止按钮,Enter 暂不生效。
| 属性 | 类型 | 默认值 | 描述 |
|---|---|---|---|
modelValue | String | "" | 输入框中的草稿,绑定 v-model;提交成功后自动清空 |
placeholder | String | "Send a message" | 输入前的占位提示 |
disabled | Boolean | false | 禁用时文字仍留在输入区域,但提交按钮不生效,Enter 只换行 |
busy | Boolean | false | 状态机处理中;提交按钮变为停止按钮,Enter 暂不提交 |
mentions | Object as PropType<{ items: MentionEntry[]; trigger?: string }> | undefined | 可提及的候选项;传入候选列表和触发字符(默认 @),组件会附着到 textarea 上;候选列表打开时,Enter 插入候选值,发送暂缓 |
| 事件 | 载荷 |
|---|---|
update:modelValue | (_value: string) => true |
submit | (_value: string) => true |
stop | () => true |