Skip to content

Commit ab12d46

Browse files
RSS1102tdesign-bot
andauthored
chore(chat): upgrade tdesign-web-components to 1.3.1-alpha.11 (#6519)
* chore: upgrade tdesign-web-components to 1.3.1-alpha.11 * chore: stash changelog [ci skip] --------- Co-authored-by: tdesign-bot <tdesign@tencent.com>
1 parent 7222ea4 commit ab12d46

File tree

5 files changed

+54
-15
lines changed

5 files changed

+54
-15
lines changed

packages/pro-components/chat/chatbot/_example/agui.vue

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,24 @@
4444
@send="sendHandler"
4545
@stop="stopHandler"
4646
>
47-
<template #suffix="{ renderPresets }">
48-
<!-- 在这里可以进行自由的组合使用,或者新增预设 -->
49-
<!-- 不需要附件操作的使用方式 -->
50-
<component :is="renderPresets([])" />
47+
<template #input-prefix> <Robot2Icon size="large" style="margin-top: 2px; margin-right: 10px" /> </template>
48+
<template #suffix>
49+
<t-button size="small" variant="text" @click="handleCustomButtonClick">
50+
<template #icon>
51+
<AiEditIcon />
52+
</template>
53+
</t-button>
5154
</template>
5255
</t-chat-sender>
56+
57+
<t-dialog
58+
v-model:visible="dialogVisible"
59+
title="输入内容"
60+
@confirm="handleDialogCancel"
61+
@cancel="handleDialogCancel"
62+
>
63+
<div>{{ dialogInputValue }}</div>
64+
</t-dialog>
5365
</div>
5466
</template>
5567

@@ -65,11 +77,14 @@ import {
6577
useChat,
6678
} from '@tdesign-vue-next/chat';
6779
import { MessagePlugin } from 'tdesign-vue-next';
80+
import { AiEditIcon, Robot2Icon } from 'tdesign-icons-vue-next';
6881
import CustomToolCallRenderer from './components/Toolcall.vue';
6982
7083
const listRef = ref<TdChatListApi | null>(null);
7184
const inputRef = ref<TdChatSenderApi | null>(null);
7285
const inputValue = ref<string>('AG-UI协议的作用是什么');
86+
const dialogVisible = ref(false);
87+
const dialogInputValue = ref('');
7388
7489
const { chatEngine, messages, status } = useChat({
7590
defaultMessages: [],
@@ -168,6 +183,17 @@ const sendHandler = async (params) => {
168183
const stopHandler = () => {
169184
chatEngine.value?.abortChat();
170185
};
186+
187+
// 自定义按钮点击处理
188+
const handleCustomButtonClick = () => {
189+
dialogVisible.value = true;
190+
dialogInputValue.value = inputValue.value;
191+
};
192+
193+
// 弹窗关闭处理
194+
const handleDialogCancel = () => {
195+
dialogVisible.value = false;
196+
};
171197
</script>
172198

173199
<style scoped>

packages/pro-components/chat/chatbot/_example/hookComponent.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,13 @@
2828
@send="sendHandler"
2929
@stop="stopHandler"
3030
>
31-
<template #suffix="{ renderPresets }">
32-
<!-- 在这里可以进行自由的组合使用,或者新增预设 -->
31+
<template #suffix>
3332
<!-- 不需要附件操作的使用方式 -->
34-
<component :is="renderPresets([])" />
33+
<t-button size="small" variant="text">
34+
<template #icon>
35+
<AppIcon />
36+
</template>
37+
</t-button>
3538
</template>
3639
</t-chat-sender>
3740
</div>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
pr_number: 6519
3+
contributor: RSS1102
4+
---
5+
6+
- fix(chatbot): `senderProps` 中配置 `input-prefix` 不生效问题 @RSS1102 ([#6519](https://github.com/Tencent/tdesign-vue-next/pull/6519))
7+
- fix(chat-sender): suffix 支持 `[{ name: 'uploadImage', uploadProps: {...} }]` 配置 @RSS1102 ([#6519](https://github.com/Tencent/tdesign-vue-next/pull/6519))
8+
- fix(chat-sender): suffix 配置 `attachment` 即将废弃,建议使用 `uploadAttachment` @RSS1102 ([#6519](https://github.com/Tencent/tdesign-vue-next/pull/6519))
9+
- Breaking Change: @RSS1102 ([#6519](https://github.com/Tencent/tdesign-vue-next/pull/6519))
10+
- ⚠️ attachment 别名即将废弃,建议使用 uploadAttachment @RSS1102 ([#6519](https://github.com/Tencent/tdesign-vue-next/pull/6519))

packages/tdesign-vue-next-chat/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"marked-highlight": "catalog:docs",
6363
"tdesign-icons-vue-next": "catalog:tdesign",
6464
"tdesign-vue-next": "workspace:^",
65-
"tdesign-web-components": "1.3.1-alpha.10",
65+
"tdesign-web-components": "1.3.1-alpha.11",
6666
"omi-vueify": "^0.0.12"
6767
},
6868
"devDependencies": {

pnpm-lock.yaml

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)