Browse Source

父子组件名的命名优化下

es6
guy 4 years ago
parent
commit
6d0af1ad63
  1. 2
      src/core/wrapper/layout/layout.card.js
  2. 2
      src/core/wrapper/layout/layout.tape.js

2
src/core/wrapper/layout/layout.card.js

@ -76,7 +76,7 @@ BI.CardLayout = BI.inherit(BI.Layout, {
},
_deleteCardByName: function (cardName) {
delete this._children[this.getName() + "_" + cardName];
delete this._children[this._getChildName(cardName)];
var index = BI.findIndex(this.options.items, function (i, item) {
return item.cardName == cardName;
});

2
src/core/wrapper/layout/layout.tape.js

@ -46,7 +46,7 @@ BI.HTapeLayout = BI.inherit(BI.Layout, {
var self = this, o = this.options;
items = BI.compact(items);
BI.each(items, function (i, item) {
if (!self.hasWidget(self.getName() + "_" + i)) {
if (!self.hasWidget(self._getChildName(i))) {
var w = BI._lazyCreateWidget(item);
self.addWidget(self._getChildName(i), w);
} else {

Loading…
Cancel
Save