fix setting add

This commit is contained in:
Harvey Zack committed 2023-04-22 15:12:45 +08:00
1 parent d34a6ba268
commit a801cd5613
3 files changed
+13 -7

No files matched your search

+6 -3
View File
@@ -93,12 +93,12 @@ export default class Setting extends Component {
this.art.events.remove(this.events[index]);
}
this.$parent.innerHTML = '';
this.events = [];
this.cache = new Map();
}
update(settings) {
this.remove();
this.events = [];
this.cache = new Map();
const settingsCopy = settings.map((item) => mergeDeep({}, item));
const mergeSettings = [...this.defaultSettings, ...settingsCopy];
this.option = Setting.makeRecursion(mergeSettings);
@@ -107,8 +107,11 @@ export default class Setting extends Component {
}
add(setting) {
this.remove();
this.option.push(setting);
return this.update(this.option);
this.option = Setting.makeRecursion(this.option);
this.render(this.option);
return this.option;
}
creatHeader(item) {