fix: 修复 layui.event 事件参数
This commit is contained in:
parent
cbba1d984a
commit
59e0f9d7bd
@ -269,9 +269,7 @@ describe('layui', function () {
|
|||||||
expect(layui.onevent()).to.deep.equal(layui);
|
expect(layui.onevent()).to.deep.equal(layui);
|
||||||
expect(layui.onevent([], [], [])).to.deep.equal(layui);
|
expect(layui.onevent([], [], [])).to.deep.equal(layui);
|
||||||
expect(layui.onevent({}, {}, {})).to.deep.equal(layui);
|
expect(layui.onevent({}, {}, {})).to.deep.equal(layui);
|
||||||
|
expect(layui.onevent('test-' + Date.now(), 'click', function () {})).to.not.deep.equal(layui);
|
||||||
var result = layui.onevent('test-' + Date.now(), 'click', function () {});
|
|
||||||
expect(result).to.deep.equal(layui);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('bind event', function (done) {
|
it('bind event', function (done) {
|
||||||
@ -279,8 +277,8 @@ describe('layui', function () {
|
|||||||
var data = {
|
var data = {
|
||||||
name: 'layui'
|
name: 'layui'
|
||||||
};
|
};
|
||||||
var result = layui.onevent(id, 'click', function (param) {
|
layui.onevent(id, 'click', function (param) {
|
||||||
expect(result).to.deep.equal(this).and.equal(layui);
|
expect(this).to.deep.equal(layui);
|
||||||
expect(param).to.deep.equal(data);
|
expect(param).to.deep.equal(data);
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user