Skip to content

Commit

Permalink
fix: 修复删除标签,然后点击选择标签,标签仍然存在的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed Nov 13, 2023
1 parent cd8e61d commit 3219fd2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/components/publish/form/PublishTags.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,18 @@ const emit = defineEmits(["emitSyncTags"])
const tagMethods = {
handleTagClose: (tag: any) => {
formData.tag.dynamicTags.splice(formData.tag.dynamicTags.indexOf(tag), 1)
// 这里不需要,平台列表是个全集
// // 检查平台标签数组中是否包含输入值,如果不包含则删除对应的项
// if (!formData.tag.platformTags.some((item) => item.value === formData.tag.inputValue)) {
// // 构造要删除的项
// const itemToRemove = {
// value: formData.tag.inputValue,
// label: formData.tag.inputValue,
// }
//
// // 通过过滤不等于要删除项的方式,更新平台标签数组
// formData.tag.platformTags = formData.tag.platformTags.filter((item) => item.value !== itemToRemove.value)
// }
emit("emitSyncTags", formData.tag.dynamicTags)
},
Expand Down

0 comments on commit 3219fd2

Please sign in to comment.