1.0.0 • Published 7 years ago

selfevent v1.0.0

Weekly downloads
1
License
ISC
Repository
-
Last release
7 years ago

#安装

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")