Skip to content
Advertisement

Javascript Vue: Where does the variable ‘e’ in onFileChange(e) originate?

Javascript Vue: Where does the variable e in onFileChange(e) originate?

In the following code, there is a variable e in onFileChange(e), where does it originate? It is never declared or imported in the code, so how can it be valid?

Any help would be greatly appreciated.

JavaScript

Advertisement

Answer

That declaration is triggered by your template, where you are binding change event to the method. The whole event as parameter gets passed to the method, Refer this section of Vue docs for better information https://v2.vuejs.org/v2/guide/events.html#Method-Event-Handlers

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement