Skip to content

Commit

Permalink
fix(web): 修复标签颜色问题
Browse files Browse the repository at this point in the history
  • Loading branch information
enncy committed Jul 3, 2024
1 parent 8459ac4 commit 83b735f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/web/src/components/Tags.vue
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,14 @@ const handleInputConfirm = () => {
let tags = props.tags;
if (inputValue && tags.map((t) => t.name).findIndex((n) => n === inputValue) === -1) {
const newTag = { name: inputValue, color: state.color };
const origin_tag = store.render.browser.tags[state.inputValue];
let newTag;
// 使用原有标签颜色
if (origin_tag && origin_tag.color !== state.color) {
newTag = { name: inputValue, color: origin_tag.color };
} else {
newTag = { name: inputValue, color: state.color };
}
tags = [...tags, newTag];
emits('create', newTag);
}
Expand Down

0 comments on commit 83b735f

Please # to comment.