11import { defineComponent , toRefs , computed } from 'vue' ;
2- import { RectangleIcon , SendIcon , StopCircleIcon } from 'tdesign-icons-vue-next' ;
2+ import { SendIcon , StopCircleIcon } from 'tdesign-icons-vue-next' ;
33import { Button , Textarea } from 'tdesign-vue-next' ;
44import { useConfig } from 'tdesign-vue-next/es/config-provider/hooks' ;
55import { useTNodeJSX , usePrefixClass , useVModel } from '@tdesign/shared-hooks' ;
66import props from './chat-input-props' ;
77
88export 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 ( ) => (
0 commit comments