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
@@ -4635,11 +4635,11 @@ class Setting extends (0, _componentDefault.default) {
remove() {
for(let index = 0; index < this.events.length; index++)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)=>(0, _utils.mergeDeep)({}, item));
const mergeSettings = [
...this.defaultSettings,
@@ -4650,8 +4650,11 @@ class Setting extends (0, _componentDefault.default) {
return this.option;
}
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) {
const { icons , proxy } = this.art;