question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
rramocommented, Mar 20, 2019

For info, I get the same issue when using “v-bind:click” instead of “v-on:click”. https://jsfiddle.net/Lvqznx9f/

0reactions
furryablackcommented, Jan 12, 2020
Read more comments on GitHub >

github_iconTop Results From Across the Web

Doesn't it support to use "$event" in custom vue event?
when I use $event in custom component, it shows vue warning in chrome console <form-item @on-form-change=“onFormChange($event,item,data)”/>.
Read more >
Custom event not captured by component in Vue.js
Instead, I am using my application state (built using Vuex store) as an event bus to update an errorObject and the ErrorMessage component...
Read more >
Introduction to Vue.js Custom Events | by John Au-Yeung
Event names aren't automatically transformed by Vue. The names of an emitted event must match the name that's used to listen to the...
Read more >
Receive events from Azure Event Grid to an HTTP endpoint
Describes how to validate an HTTP endpoint, then receive and deserialize Events from Azure Event Grid.
Read more >
Window: popstate event - Web APIs | MDN
pushState() has been used to add a history entry to the history stack, that history entry is used instead. Syntax. Use the event...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found