-
Notifications
You must be signed in to change notification settings - Fork 380
Fix Emit Decorator with multiple arguments #306
Conversation
I think this.$emit(emitName, returnValue) should pass this.$emit(emitName, returnValue, ...args) Isn't it? |
@WolfgangKurz How about this? |
Yes, we need Thanks for your response and fixing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your PR!!!
Could you fix this?
Hi. I don't know if you guys noticed, but PR #291 broke the emit decorator as is defined in the documentation. Now, if the function returns a value, the arguments received by the function are not emitted as arguments of the event, as the documentation states and as used to work before. |
Yes. I intend to do so. At least the test I added in this PR should work with code prior to #291. |
Nice work everyone, I really forgot that the arguments went along with the $emit. Sorry about the problems. PD: I think in testing, missing when you have a one argument and return that argument only (That is why I created the PR #291 ). @Component
class ChildComponent extends Vue {
count = 0
@Emit()
count(n: number) {
return n;
}
} |
When using Emit with multiple arguments, it will not work properly.
Maybe because the arguments are passed as an array
b9f0ba8#diff-a542f5e3653e6b2d1bd03489368849b9R269