This commit is contained in:
Harvey Zack committed 2022-04-25 22:11:46 +08:00
1 parent 3d37b5e056
commit c9e45567ab
3 files changed
+21 -5

No files matched your search

+10 -2
View File
@@ -33,6 +33,7 @@ export default class Setting extends Component {
this.width = 250;
this.option = [];
this.events = [];
this.cache = new Map();
if (option.setting) {
@@ -98,10 +99,12 @@ export default class Setting extends Component {
append($left, $iconLeft);
append($left, item._parentItem.html);
proxy($item, 'click', () => {
const event = proxy($item, 'click', () => {
this.init(item._parentList);
});
this.events.push(event);
return $item;
}
@@ -158,7 +161,7 @@ export default class Setting extends Component {
append($right, $iconRight);
}
proxy($item, 'click', (event) => {
const event = proxy($item, 'click', (event) => {
if (hasChildren) {
this.init(item.selector, item.width);
} else {
@@ -179,6 +182,8 @@ export default class Setting extends Component {
}
});
this.events.push(event);
return $item;
}
@@ -190,6 +195,9 @@ export default class Setting extends Component {
}
this.cache = new Map();
this.events.forEach((event) => event());
this.events = [];
this.$parent.innerHTML = '';
this.option = makeRecursion(this.option);
this.init(this.option);
}