Skip to content

Commit

Permalink
refactor: make sure setupContext.emit always reference current emit o…
Browse files Browse the repository at this point in the history
…n instance

This is dev only and for internal use by vue-test-utils.
  • Loading branch information
yyx990803 committed Apr 13, 2020
1 parent 4e54243 commit 5968cff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/runtime-core/src/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ function createSetupContext(instance: ComponentInternalInstance): SetupContext {
return new Proxy(instance.slots, slotsHandlers)
},
get emit() {
return instance.emit
return (event: string, ...args: any[]) => instance.emit(event, ...args)
}
})
} else {
Expand Down

0 comments on commit 5968cff

Please sign in to comment.