Skip to content

Commit baaed5a

Browse files
committed
fix: 修复提及输入框的禁用按钮bug
1 parent 2f52b96 commit baaed5a

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

packages/components/src/components/MentionSender/components/SendButton/index.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,19 @@
22
<script setup lang="ts">
33
import { Top } from '@element-plus/icons-vue'
44
5+
const props = defineProps({
6+
disabled: {
7+
type: Boolean,
8+
default: false,
9+
},
10+
})
11+
512
const 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>

packages/components/src/components/MentionSender/index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ function stopRecognition() {
150150
151151
/* 输入框事件 开始 */
152152
function 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

0 commit comments

Comments
 (0)