support attach

This commit is contained in:
Timi
2026-09-26 14:20:18 +08:00
parent 2b92012c39
commit a20e051e8a
7 changed files with 140 additions and 53 deletions
+6 -1
View File
@@ -28,6 +28,10 @@ const {
} = useAiChat({
request: ({ message, signal }) => fetchReply(message, signal)
});
function selectAttachment() {
// 在业务侧打开文件选择器
}
</script>
<template>
@@ -41,6 +45,7 @@ const {
@stop="stopGeneration"
@retry="retryLastMessage"
@new-conversation="resetConversation"
@add-attachment="selectAttachment"
/>
</template>
```
@@ -64,7 +69,7 @@ const {
## 自定义
`welcome`、`composer`、`tool-status`、`message` 等插槽可以替换对应区域。`composer` 插槽会拿到 `draft`、`on-send`、`on-stop`、`on-retry`、`on-new-conversation` 等,便于接入自定义输入框。
`welcome`、`composer`、`tool-status`、`message` 等插槽可以替换对应区域。`composer` 插槽会拿到 `draft`、`on-send`、`on-stop`、`on-retry`、`on-new-conversation`、`on-add-attachment` 等,便于接入自定义输入框。
## API