diff --git a/src/ProChat/components/InputArea/index.tsx b/src/ProChat/components/InputArea/index.tsx index e32c27ed..d7e79cbc 100644 --- a/src/ProChat/components/InputArea/index.tsx +++ b/src/ProChat/components/InputArea/index.tsx @@ -52,10 +52,11 @@ const useStyles = createStyles(({ css, responsive, token }) => ({ })); export const InputArea = ({}) => { - const [sendMessage, isLoading, placeholder] = useStore((s) => [ + const [sendMessage, isLoading, placeholder, inputAreaProps] = useStore((s) => [ s.sendMessage, !!s.chatLoadingId, s.placeholder, + s.inputAreaProps, ]); const [message, setMessage] = useState(''); const isChineseInput = useRef(false); @@ -84,8 +85,10 @@ export const InputArea = ({}) => { { setMessage(e.target.value); }} @@ -96,7 +99,6 @@ export const InputArea = ({}) => { onCompositionEnd={() => { isChineseInput.current = false; }} - className={styles.input} onPressEnter={(e) => { if (!isLoading && !e.shiftKey && !isChineseInput.current) { e.preventDefault(); diff --git a/src/ProChat/store/initialState.ts b/src/ProChat/store/initialState.ts index 684a9299..779872d3 100644 --- a/src/ProChat/store/initialState.ts +++ b/src/ProChat/store/initialState.ts @@ -2,6 +2,7 @@ import { DEFAULT_AVATAR, DEFAULT_USER_AVATAR } from '@/ProChat/const/meta'; import { ModelConfig } from '@/ProChat/types/config'; import { MetaData } from '@/ProChat/types/meta'; import { ChatMessage, ChatMessageMap } from '@/types/message'; +import { TextAreaProps } from 'antd/es/input'; export type ChatRequest = (messages: ChatMessage[], config: ModelConfig) => Promise; @@ -47,6 +48,11 @@ export interface ChatPropsState { */ placeholder?: string; + /** + * 输入框的 props,优先级最高 + */ + inputAreaProps?: TextAreaProps; + /** * 信息框额外渲染 */