1.0.0 • Published 7 years ago
selfevent v1.0.0
#安装
npm install selfevent --save
#example
import SelfEvent from 'selfevent'
var tip = document.getElementsByTagName('div')[0]
var say = function (e) { console.log(e.msg) }
var ha = new SelfEvent(tip)
ha.createEvent()
ha.on(say)
ha.emit('hello world')
ha.remove(say)
ha.emit("2hello world")
ha.on(say)
ha.emit("3hello world")
1.0.0
7 years ago