diff --git a/src/components/Course/courseForm.vue b/src/components/Course/courseForm.vue index 75bee0e2..b473899d 100644 --- a/src/components/Course/courseForm.vue +++ b/src/components/Course/courseForm.vue @@ -606,8 +606,6 @@ export default { console.log("父组件:",tags) // 限制最多5个标签 if (tags.length > 5) { - console.log("最多只能选择5个标签 tags : ",this.courseInfo.tags) - console.log("最多只能选择5个标签 showTags : ",this.showTags) this.$message.warning('最多只能选择5个标签') return } @@ -618,6 +616,8 @@ export default { }) this.courseInfo.tags = ids; console.log("父组件ids : ",this.courseInfo.tags) + // 同时更新showTags,确保显示与实际数据一致 + this.showTags = tags.map(tag => tag.tagName); }, showChooseOrg(){ this.$refs.refChooseOrg.dlgShow = true;