wujingjing
2025-04-09 28706df7da34b8854cdce96ad89c035eaded6ea9
src/components/chat/smallChat/ChatInput.vue
@@ -19,12 +19,14 @@
            :autosize="{ minRows: 1, maxRows: 3 }"
            v-elInputFocus
            show-word-limit
            @input="inputting"
            v-model="inputText"
            placeholder="请输入问题"
            placeholder="请输入操作"
            clearable
            @keydown.enter="handleEnterPress"
            @keydown="keydownInput"
         >
         </el-input>
         <InputTip ref="inputTipRef" :inputValue="inputText" @updateInputValue="updateInputValue" :isHome="false" />
      </div>
      <div class="h100 flex items-end">
         <div class="upload_img space-y">
@@ -39,7 +41,7 @@
                  v-if="inputText"
               >
               </el-button>
               <el-tooltip placement="top" content="停止生成" v-if="isTalking">
               <el-tooltip placement="top" content="停止操作" v-if="isTalking">
                  <div class="cursor-pointer !ml-0 size-[38px] bg-[#1d86ff] relative !z-10 rounded-full flex-center" link>
                     <div
                        class="size-[38px] bg-black text-white stop-breathe box-content rounded-full flex-center"
@@ -62,7 +64,10 @@
<script setup lang="ts" name="ChatInput">
import { Clock } from '@element-plus/icons-vue';
import type { InputInstance } from 'element-plus';
import { useInputEvent } from './useInputEvent';
import InputTip from './inputTip/index.vue';
import { ref } from 'vue';
const inputText = defineModel('modelValue', {
   type: String,
   default: '',
@@ -102,6 +107,19 @@
const toggleHistory = () => {
   emits('toggleHistory');
};
const updateInputValue = (val) => {
   inputText.value = val;
};
const inputRef = ref<InputInstance>(null);
const { keydownInput, inputText:inputting, inputTipRef } = useInputEvent({
   props: props,
   emit: emits,
   inputValue: inputText,
   inputRef: inputRef,
});
</script>
<style scoped lang="scss">