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 ccf5ca9 commit cd8e61d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/components/publish/form/PublishTags.vue
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,15 @@ const tagMethods = {
},
handleTagInputConfirm: () => {
if (formData.tag.inputValue) {
formData.tag.dynamicTags.push(formData.tag.inputValue)
if (!formData.tag.dynamicTags.includes(formData.tag.inputValue)) {
formData.tag.dynamicTags.push(formData.tag.inputValue)
}
if (!formData.tag.platformTags.includes(formData.tag.inputValue)) {
formData.tag.platformTags.push({
value: formData.tag.inputValue,
label: formData.tag.inputValue,
})
}
emit("emitSyncTags", formData.tag.dynamicTags)
}
Expand Down
3 changes: 2 additions & 1 deletion src/composables/usePublish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,8 @@ const usePublish = () => {
mergedPost.html = siyuanPost.html
mergedPost.description = siyuanPost.description
// 标签分类需要合并
mergedPost = initPublishMethods.doMergeBatchPost(siyuanPost, mergedPost)
// fix: 不合并,以平台为准
// mergedPost = initPublishMethods.doMergeBatchPost(siyuanPost, mergedPost)

// 更新预览链接
postPreviewUrl = await getPostPreviewUrl(api, id, cfg)
Expand Down

0 comments on commit cd8e61d

Please sign in to comment.