chore: 前端其余页面和资源文件
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
var Event = {
|
||||
EVENT: {},
|
||||
emit (eventName, resp) {
|
||||
if (this.EVENT[eventName] && Object.prototype.toString.call(this.EVENT[eventName]) === "[object Array]") {
|
||||
for (let i = 0, fn; fn = this.EVENT[eventName][i++];) {
|
||||
fn(resp)
|
||||
}
|
||||
}
|
||||
},
|
||||
on (name, fn) {
|
||||
if (this.EVENT[name] && Object.prototype.toString.call(this.EVENT[name]) === "[object Array]") {
|
||||
this.EVENT[name].push(fn)
|
||||
} else {
|
||||
this.EVENT[name] = [fn]
|
||||
}
|
||||
},
|
||||
off (name) {
|
||||
this.EVENT[name] = null
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user