Skip to content

Commit 5968cff

Browse files
committed
refactor: make sure setupContext.emit always reference current emit on instance
This is dev only and for internal use by vue-test-utils.
1 parent 4e54243 commit 5968cff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/runtime-core/src/component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ function createSetupContext(instance: ComponentInternalInstance): SetupContext {
517517
return new Proxy(instance.slots, slotsHandlers)
518518
},
519519
get emit() {
520-
return instance.emit
520+
return (event: string, ...args: any[]) => instance.emit(event, ...args)
521521
}
522522
})
523523
} else {

0 commit comments

Comments
 (0)