Skip to content

Doesn’t it support to use “$event” in custom vue event? #8617

@TonyLuo

Description

@TonyLuo

Version

2.5.17

Steps to reproduce

<my-component @my-event=“handleThis(123, $event)”>

What is expected?

no warning

What is actually happening?

[Vue warn]: Property or method "$event" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property. See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.


when I use $event in custom component, it shows vue warning in chrome console

[Vue warn]: Property or method "$event" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property. See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions