diff --git a/src/components/Course/courseTag.vue b/src/components/Course/courseTag.vue index 4b64113c..b87ac90a 100644 --- a/src/components/Course/courseTag.vue +++ b/src/components/Course/courseTag.vue @@ -230,6 +230,12 @@ export default { this.$message.error('标签不能超过8个字') return; } + // 检查标签是否在下拉框中已存在 + const isExistInSearch = this.searchResults.some(tag => tag.tagName === tagName); + if (isExistInSearch) { + this.$message.warning('已存在此标签,请选择'); + return; + } // 首先检查是否与已选择的标签重复 const isDuplicate = this.selectedTags.some(tag => tag.tagName === tagName); if (isDuplicate) {