Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork698
Open
Description
Please describe what the rule should do:
When emitting an event, one can pass an event payload. This can consist of multiple parameters. However, when using thealways style in the event handler, one can only receive the first event payload parameter.
<my-button @my-event="myHandler($event)" />
See also thevue/v-on-function-call rule and#2001 (comment).
What category should the rule belong to?
[ ] Enforces code style (layout)
[x] Warns about a potential error (problem)
[ ] Suggests an alternate way of doing something (suggestion)
[ ] Other (please specify:)
Provide 2-3 code examples that this rule should warn about:
// BAD:this.$emit('my-event',foo,bar)emit('my-event',foo,bar)defineEmits({'my-event':(foo,bar)=>true})defineEmits({'my-event':(foo:string,bar:string)=>true})defineEmits<{(e:'my-event',foo:string,bar:string):void}>(){emits:{'my-event':(foo,bar)=>true}}{emits:{'my-event':(foo:string,bar:string)=>true}}// GOOD:this.$emit('my-event',foo)emit('my-event',foo)defineEmits(['my-event'])defineEmits({'my-event':null})defineEmits({'my-event':(foo)=>true})defineEmits({'my-event':(foo:string)=>true})defineEmits<{(e:'my-event',foo:string):void}>(){emits:['my-event']}{ emits:{'my-event':null}{emits:{'my-event':(foo)=>true}}{ emits:{'my-event':(foo:string)=>true}}