Feat: destroy() method for widgets to do custom cleanup (#6699)

* feat: inform child widget to do some custom cleanup

* fix: type

* refactor: restore old removeChildDomNodes

* refactor: make destroy() a separate method

* refactor: make destroy call removeChildDomNodes

* refactor: call destroy instead of removeChildDomNodes in each core widgets

* fix: refreshSelf does not mean destroy

* refactor: use old var insteadof const

* docs: about subclass
This commit is contained in:
lin onetwo
2023-05-06 19:19:11 +08:00
committed by GitHub
parent 2b95daf59b
commit 474b73bdbe
8 changed files with 37 additions and 14 deletions

View File

@@ -80,7 +80,7 @@ StackedListView.prototype.insert = function(widget) {
};
StackedListView.prototype.remove = function(widget) {
widget.removeChildDomNodes();
widget.destroy();
};
exports.stacked = StackedListView;