【文件属性】:
文件名称:EventModel:JavaScript 的事件模型
文件大小:3KB
文件格式:ZIP
更新时间:2021-06-17 14:26:04
JavaScript
事件模型
演示
var EventModel = require ( './eventmodel.js' ) ;
// Define a constructor A
var A = function ( ) { } ;
// Create a instance from A
var a = new A ( ) ;
// Bind 'test' event for 'a'
EventModel . on ( a , 'test' , function ( e ) {
console . log ( 'a' , e ) ;
} ) ;
// Bind 'test' event for 'A.prototype'
EventModel . on ( A . prototype , 'test' , function ( e ) {
console . log ( 'A.prototyp
【文件预览】:
EventModel-2.0
----README.md(843B)
----tests()
--------bubbling.js(1KB)
--------inheritance.js(554B)
----test.sh(192B)
----package.json(499B)
----eventmodel.js(3KB)