/**
* 添加一个组件实例到大屏中
*
* @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;
}
jeck猫
凤凰求蛊
随时随地看视频慕课网APP
相关分类