Browse Source

无JIRA tab添加子card destory监听

(cherry picked from commit df79823d5a)
master
翠屏山最速下山传说 3 months ago
parent
commit
0395933470
  1. 9
      packages/fineui/src/base/combination/tab.js

9
packages/fineui/src/base/combination/tab.js

@ -13,7 +13,8 @@ import {
contains,
any,
isEqual,
LogicFactory
LogicFactory,
Events,
} from "@/core";
/**
@ -106,7 +107,11 @@ export class Tab extends Widget {
Widget.execWithContext(this, () => {
this.cardMap[v] = cardCreator(v);
});
this.layout.addCardByName(v, this.cardMap[v]);
const card = this.layout.addCardByName(v, this.cardMap[v]);
card.on(Events.DESTROY, () => {
this.layout.deleteCardByName(v);
delete this.cardMap[v];
});
}
}

Loading…
Cancel
Save