问题1
来源:3-5 通用图文组件类-H5ComponentBase(参数设置)
leo_dev
2016-06-20
function H5ComponentBase(conf){
this.conf = conf || {};
this.component = $('<div class="h5-component"></div>');
this.init();
return this.component;
}
H5ComponentBase.prototype.init = function(){
if (conf.text) {
this.component.text(conf.text);
}
};老师我这样创建可以吗?
写回答
1回答
-
Lyn_Tech
2016-06-21
没有问题。反正 H5ComponentBase 是需要 new 出来的 ,在原型链上可以找的到。
00
相似问题