Vanessa 2023-10-20 11:45:39 +08:00
parent 4047f95016
commit 33dfa0de4e
3 changed files with 37 additions and 5 deletions

View file

@ -20,7 +20,7 @@ export class EventBus<DetailType = any> {
}
emit(type: TEventBus, detail?: DetailType) {
return this.eventTarget.dispatchEvent(new CustomEvent(type, {detail}));
return this.eventTarget.dispatchEvent(new CustomEvent(type, {detail, cancelable: true}));
}
}