New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a global config to show event handlers during development #7532
Comments
Related answer: #2415 (comment) Personally, I think to add this only in development would potentially create other problems that would make debugging harder. It's also necessary to keep them in sync while updating the HTML which would take quite some effort for questionable gain. Are you aware of vue devtools? They make Vue apps debugging much easier |
@posva Actually, it's quite easy to add this feature, and I'm already using it during development. In function _createElement: |
I see no point in implementing such a thing. Why?
|
This is not something that should be done by Vue. Chrome already gives you the ability to inspect listeners on arbitrary DOM elements. |
@yyx990803 However, I think the Chrome inspector's listeners shown in Vue apps are not readable. |
What problem does this feature solve?
During development, it's hard to find out what method is used to handle events on the element using browser's DOM inspector. If it's able to see the handler's name or content during development, it will be easier for the developer to locate the handler's code.
What does the proposed API look like?
Set global config:
then the handlers can be seen in the DOM inspector:
since '@' is not valid in Element.setAttribute, I changed it to 'v-on:'
The text was updated successfully, but these errors were encountered: