@ -20,34 +20,53 @@
}
},
setup: function () {
var layout;
var list, count = 0;
return function () {
return {
type: "bi.left",
type: "bi.vertical",
items: [{
type: "bi.button",
text: "点击",
handler: function () {
layout.populate([{
type: "bi.label",
key: "1",
text: 1
}, {
type: "bi.virtual_group",
height: 100,
ref: function (_ref) {
list = _ref;
items: BI.range(10).map(function (item, i) {
var r = {
key: "123",
text: "start"
}])
text: item,
// 指定key后,会根据key值进行前后两次数据对比,否则会根据数组索引进行数据对比
key: item,
cls: "bi-border"
};
if (i === 9) {
r.width = "fill";
r.key = "唯一的标识";
return r;
}),
layouts: [{
type: "bi.inline",
tgap: 10,
lgap: 10
}]
lgap: 10,
}],
layout = _ref;
text: "点击删除第一个元素",
count++;
list.populate(BI.range(10 - count).map(function (i) {
text: i + count,
key: i + count,
if (i + count === 9) {
}));
@ -551,9 +551,11 @@ BI.Layout = BI.inherit(BI.Widget, {
c.destroy();
});
this._children = {};
this._isMounted = false;
this.options.items = opt.items;
this.stroke(opt.items);
this._mount();
update: function (opt) {