mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-09 02:46:44 +08:00
调试
This commit is contained in:
@@ -607,6 +607,27 @@ export default {
|
||||
// 限制最多5个标签
|
||||
if (tags.length > 5) {
|
||||
this.$message.warning('最多只能选择5个标签')
|
||||
// 只保留前5个标签
|
||||
const limitedTags = tags.slice(0, 5)
|
||||
// 更新标签显示
|
||||
let ids = "";
|
||||
limitedTags.forEach(tag => {
|
||||
console.log("父组件name : ", tag.tagName)
|
||||
ids += tag.id + ',';
|
||||
})
|
||||
this.courseInfo.tags = ids;
|
||||
console.log("父组件ids : ", this.courseInfo.tags)
|
||||
|
||||
// 更新showTags,确保显示与实际数据一致
|
||||
this.showTags = limitedTags.map(tag => tag.tagName);
|
||||
|
||||
// 重要:返回截断后的标签数组,确保子组件也同步更新
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.courseTag) {
|
||||
// 通知子组件同步标签状态
|
||||
this.$refs.courseTag.syncTags(limitedTags);
|
||||
}
|
||||
});
|
||||
return
|
||||
}
|
||||
let ids = "";
|
||||
|
||||
@@ -2694,7 +2694,7 @@ a.custom2 {
|
||||
gap: 15px;
|
||||
align-items: center;
|
||||
padding-top: 2px;
|
||||
margin-left: 90px; /* 为"热点标签:"文本留出空间 */
|
||||
//margin-left: 90px; /* 为"热点标签:"文本留出空间 */
|
||||
}
|
||||
|
||||
/* 调整option-item样式以适应换行布局 */
|
||||
|
||||
Reference in New Issue
Block a user