Skip to content

Commit

Permalink
新增自定义事件
Browse files Browse the repository at this point in the history
  • Loading branch information
sheep-realms committed Sep 30, 2023
1 parent 7d12415 commit 6554949
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion js/echo.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class Echo {
this.event = {
backspace: function() {},
clear: function() {},
customEvent: function() {},
groupEnd: function() {},
groupStart: function() {},
next: function() {},
Expand Down Expand Up @@ -99,6 +100,9 @@ class Echo {
if (obj?.printSpeed) {
this.speed(obj.printSpeed);
}
if (obj?.event) {
this.event.customEvent(obj.event);
}
this.event.groupStart(e);
return e;
}
Expand All @@ -112,7 +116,8 @@ class Echo {
class: msg?.class,
style: msg?.style,
typewrite: msg?.typewrite,
printSpeed: msg?.speed
printSpeed: msg?.speed,
event: msg?.event
};

let dataAfter = {
Expand Down

0 comments on commit 6554949

Please sign in to comment.