function-update-optimize (#549)

This commit is contained in:
O2bmm authored and GitHub committed 2023-06-02 15:18:03 +08:00
1 parent 7fc369d210
commit 16994e446e
1 file changed
+4 -1
+4 -1
View File
@@ -173,7 +173,10 @@ export default class Component {
update(option) {
const item = this.cache.get(option.name);
if (item) this.remove(option.name);
if (item) {
option = Object.assign(item.option, option);
this.remove(option.name);
}
return this.add(option);
}
}