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
[Proposal] More Verbose Component Tree #331
Conversation
This commit allows to have components show more verbose by letting components have individual names. This can be useful for lists or forms.
I really don't like the need of creating a useless computed property with a specific name to make it work. However, displaying the |
Hey @posva, thx for the comment. You suggested using the I'll try to justify why I would still say something like the PR could be beneficial. Maybe we can change the implementation a bit. There are 2 problems with this from my understanding. Problems with having a
|
the real problem with key is actually the same that the computed property: we cannot force the developer to add a property to the component that only has an impact in devtools. If people start using the key attribute to simply have a more precise display on the devtools, that's misusing the key attribute.
About the other changes, there's a similar problem, we're adding code that has no impact in the app, it shall be removed when bundling or something else and it's not worth the cost... Even if it's call |
yes, distinguish same components in dev tools to make it easier to select them |
that's true. okay I guess we could wait for other opinions or ideas how to make it work. I'm not super familiar with the vue core so I might not come up with the best possible solution at this point. Thx for your opinion again |
Hey @armano2 thx for the thumbs down. Can you explain why you don't like this? Best, |
Hello, right now we already have name property for component's I will prefer to see that name is reactive with possibility to pass function and let ppl do whatever they want there instead forcing us to make computed property with no side effect. |
The computed property has been discussed already. We all agree it shouldn't go into the computed properties because that's where the business logic is and we don't want to mix it up with the tooling. The latest suggestion is that it could be next to the
|
But it's becoming more obvious to me that nobody really cares about this. So maybe we close that and call it a day. It was still interesting to me to make it work and I'll still use it in our project. Unfortunately I'm not sure how to make the version above work. So I'm going to keep the computed properties. Still thx for the responses. I get your opinion. |
Someone on Stackoverflow was asking if it was possible to show individual component names in the component tree.
Subconsciously I always wanted this as well.
So why not give it a shot.
It works by implementing an optional computed value
instanceName
in the components.This could be useful for lists but also for input components to show the name of the input.
Please let me know if there are any suggestions or critique.
Stackoverflow:
https://stackoverflow.com/questions/40936918/how-to-distinguish-between-component-instances-in-vue-devtools
Best,
Christian