refactor: make sure setupContext.emit always reference current emit on instance

This is dev only and for internal use by vue-test-utils.
This commit is contained in:
Evan You 2020-04-13 10:06:41 -04:00
parent 4e54243189
commit 5968cff3a8

View File

@ -517,7 +517,7 @@ function createSetupContext(instance: ComponentInternalInstance): SetupContext {
return new Proxy(instance.slots, slotsHandlers) return new Proxy(instance.slots, slotsHandlers)
}, },
get emit() { get emit() {
return instance.emit return (event: string, ...args: any[]) => instance.emit(event, ...args)
} }
}) })
} else { } else {