tlx6550
2016-07-06 15:21
为什么提示报错呢?

on:function(type,handler){
var bb = this.handlers[type];
if (typeof this.handlers[type] == "undefined") {
this.handlers[type]=[];
}
this.handlers[type].push(handler);
// 实现连缀语法
return this;
},
fire:function(type,data){
var aa = this.handlers[type];
if(this.handlers[type] instanceof Array){
var handlers = this.handlers[type];
for(var i=0,len=handlers.length;i<len;i++){
handlers[i](data);
}
}
}
有没有更完整的代码,你的fire在哪里触发的,还有你调用组件的代码呢,发来看一下?
阿当大话西游之WEB组件
26365 学习 · 278 问题