File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
packages/components/src/components/MentionSender Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 22<script setup lang="ts">
33import { Top } from ' @element-plus/icons-vue'
44
5+ const props = defineProps ({
6+ disabled: {
7+ type: Boolean ,
8+ default: false ,
9+ },
10+ })
11+
512const emits = defineEmits ([' submit' ])
613 </script >
714
815<template >
916 <div class =" el-send-button" >
10- <el-button circle @click =" emits('submit')" >
17+ <el-button circle :disabled = " props.disabled " @click =" emits('submit')" >
1118 <el-icon ><Top /></el-icon >
1219 </el-button >
1320 </div >
Original file line number Diff line number Diff line change @@ -150,7 +150,7 @@ function stopRecognition() {
150150
151151/* 输入框事件 开始 */
152152function submit() {
153- if (props .readOnly || props .loading || props .disabled )
153+ if (props .readOnly || props .loading || props .disabled || ! internalValue . value )
154154 return
155155 emits (' submit' , internalValue .value )
156156}
@@ -374,7 +374,7 @@ defineExpose({
374374 <div
375375 class =" el-sender-action-list-presets"
376376 >
377- <SendButton v-if =" !loading" @submit =" submit" />
377+ <SendButton v-if =" !loading" :disabled = " !internalValue " @submit =" submit" />
378378
379379 <LoadingButton v-if =" loading" @cancel =" cancel" />
380380
You can’t perform that action at this time.
0 commit comments