From 305a5481c87c0536eb0c92484ae561f6d370e4ef Mon Sep 17 00:00:00 2001 From: 670788339 <670788339@qq.com> Date: Tue, 4 Nov 2025 10:02:27 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Course/courseTag.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/Course/courseTag.vue b/src/components/Course/courseTag.vue index bfa95a85..b4e682ff 100644 --- a/src/components/Course/courseTag.vue +++ b/src/components/Course/courseTag.vue @@ -169,7 +169,12 @@ export default { //按回车键,创建新标签 handleEnterKey(event) { + console.log('开始回车创建 = ' + event.target.value) const inputVal = event.target.value?.trim() + console.log('回车创建 inputVal= ' + inputVal) + this.clearInput(); + console.log('回车创建中 先清文字 inputVal = ' + inputVal) + if (!inputVal) return; // 检查是否与已选择的标签重复 const isDuplicate = this.selectedTags.some(tag => tag.tagName === inputVal); @@ -204,8 +209,8 @@ export default { this.previousTags = [...newValues]; this.$emit('change', this.displayTags); console.log('-- handleSelectionChange clearInput --- this.$refs.tagSelect = ' + this.$refs.tagSelect ) - console.log('-- handleSelectionChange clearInput --- input.value = ' + this.$refs.tagSelect.$refs.input ) this.clearInput(); + console.log('-- handleSelectionChange clearInput --- input.value = ' + this.$refs.tagSelect.$refs.input ) }, clearInput() {