Skip to content

Commit bb5ea16

Browse files
fix(chat-input): fix suffixIcon type not slot, reactive invalid (#5905)
* fix(chat-input): fix suffixIcon type not slot, reactive invalid * chore: remove unused code * chore: stash changelog [ci skip] --------- Co-authored-by: tdesign-bot <[email protected]>
1 parent 16973a2 commit bb5ea16

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

packages/pro-components/chat/chat-input.tsx

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
11
import { defineComponent, toRefs, computed } from 'vue';
2-
import { RectangleIcon, SendIcon, StopCircleIcon } from 'tdesign-icons-vue-next';
2+
import { SendIcon, StopCircleIcon } from 'tdesign-icons-vue-next';
33
import { Button, Textarea } from 'tdesign-vue-next';
44
import { useConfig } from 'tdesign-vue-next/es/config-provider/hooks';
55
import { useTNodeJSX, usePrefixClass, useVModel } from '@tdesign/shared-hooks';
66
import props from './chat-input-props';
77

88
export default defineComponent({
99
name: 'TChatInput',
10-
components: {
11-
RectangleIcon,
12-
SendIcon,
13-
},
1410
props,
1511
emits: ['send', 'stop', 'update:modelValue', 'blur', 'focus'], // declare the custom events here
16-
setup(props, { slots, emit }) {
12+
setup(props, { emit }) {
1713
const COMPONENT_NAME = usePrefixClass('chat');
1814
const { globalConfig } = useConfig('chat');
1915
const { value, modelValue } = toRefs(props);
@@ -32,7 +28,6 @@ export default defineComponent({
3228
let shiftDownFlag = false;
3329
let isComposition = false;
3430
const renderTNodeJSX = useTNodeJSX();
35-
const suffixIcon = renderTNodeJSX('suffixIcon') || slots.suffixIcon;
3631
const sendClick = (e: MouseEvent | KeyboardEvent) => {
3732
if (textValue.value && !disabled.value) {
3833
emit('send', textValue.value, { e });
@@ -105,6 +100,7 @@ export default defineComponent({
105100
);
106101
};
107102
const renderSuffixIcon = () => {
103+
const suffixIcon = renderTNodeJSX('suffixIcon');
108104
return suffixIcon ? suffixIcon : getDefaultSuffixIcon();
109105
};
110106
return () => (
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
pr_number: 5905
3+
contributor: liweijie0812
4+
---
5+
6+
- fix(chat-input): 修复 `suffixIcon` 传值不是插槽,响应式无效 @liweijie0812 ([#5905](https://github.com/Tencent/tdesign-vue-next/pull/5905))

0 commit comments

Comments
 (0)