/** * 添加一个组件实例到大屏中 * * @param {Component} component 组件实例 * @return {Screen} */ addComponent: function (component) { var self = this; // 绑定组件的所有事件 component.bind(function (event) { var args = Array.prototype.slice.call(arguments, 1); args.unshift(this); args.unshift('component.' + event); self.dispatch.apply(self, args); }); // 添加到大屏中 component.render(self.container); // 放入列表中 self.componentsById[component.id] = component; return self; }
添加回答
举报
0/150
提交
取消