Skip to content

Commit

Permalink
Merge pull request godbasin#2 from KKKyrie/ebook-sourcecode
Browse files Browse the repository at this point in the history
[fix]: typing error
  • Loading branch information
godbasin authored Feb 24, 2020
2 parents c172d61 + 7457a84 commit 4a69a14
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/vue-ebook/11.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ function on(eventName, callback) {
let event = events.find(x => x.eventName === eventName);
if (event) {
// 如果已有该事件,添加到监听者中
event.addListrner(callback);
event.addListener(callback);
} else {
// 如果没有该事件,则添加新事件,并添加到监听者
event = new MyEvent(eventName);
event.addListrner(callback);
event.addListener(callback);
events.push(event);
}
}
Expand Down Expand Up @@ -131,7 +131,7 @@ class MyEvent {
});
}
// 添加监听者
addListrner(callback) {
addListener(callback) {
this.listeners.push(callback);
}
}
Expand Down

0 comments on commit 4a69a14

Please sign in to comment.