mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-11-28 02:55:18 +08:00
🐛 Docs: 修复表单标签状态更新 (#2558)
This commit is contained in:
parent
30ceea4287
commit
c5e114dc7f
@ -39,13 +39,15 @@ export default function TagFormItem({
|
||||
}
|
||||
if (validateTag()) {
|
||||
const tag: TagType = { label, color };
|
||||
setTags([...tags, tag]);
|
||||
onTagUpdate(tags);
|
||||
const newTags = [...tags, tag];
|
||||
setTags(newTags);
|
||||
onTagUpdate(newTags);
|
||||
}
|
||||
};
|
||||
const delTag = (index: number) => {
|
||||
setTags(tags.filter((_, i) => i !== index));
|
||||
onTagUpdate(tags);
|
||||
const newTags = tags.filter((_, i) => i !== index);
|
||||
setTags(newTags);
|
||||
onTagUpdate(newTags);
|
||||
};
|
||||
const onChangeColor = (color: ColorResult) => {
|
||||
setColor(color.hex as TagType["color"]);
|
||||
|
Loading…
Reference in New Issue
Block a user