use of `arguments` inline with Vue event handler results in error `ReferenceError: arguments is not defined`
Version
3.0.5
Reproduction link
https://jsfiddle.net/osxLw5p9/
Steps to reproduce
Use arguments
inline, in the events handler body, and then emit an event up to trigger the handler.
Example: <component @my-event="handleEvent('thing', ...arguments)" />
What is expected?
arguments
is accessible (per past Vue 2 functionality).
Or, a note in migration guide about arguments
inaccessible in Vue 3.
What is actually happening?
arguments
not defined error.
In the past arguments
has been mentioned as a way to access arbitrary parameters, e.g. through spread operator:
https://github.com/vuejs/vue/issues/5527#issuecomment-297600033
The genearted code uses an arrow function. You should use <component @my-event="(...args) => handleEvent('thing', ...args)" />
. I would say this should be documented
I would say this should be documented
Definitely, should be added to the migration guide since it's a 2 -> 3 breaking change.