-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Inspect $refs #450
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
can you elaborate a bit on why it would be nice? |
Sometimes I need to see is inside a certain ref. Sometimes a ref is Being able to see the |
Personally, I think it could be useful to highlight content as you hover them (pretty much like in the components panel) because you sometimes need to locate refs in the page and, as you said, know if they exist (undefined or not) |
Yea, the ability to go from the vue devtools page to the Elements page would be really cool. |
I think I could implement it over the weekend, let me try and get a PR going. |
I've sat with this problems for a couple of hours and I think it might not be possible to do this functionality now. I've encountered the same problem when trying to implement context menu's
We're left with text 'HTMLElement' after serialization which is virtually useless. Anyone has idea how to work around it? EDIT: fixed typos |
@posva is it possible as a first step for now to at least show the available refs under each component ? |
I don't think listing only the names of the refs is enough to actually be useful 🙁 You'll end up just clicking on the element in the devtools and writing |
Would like to see the list of $refs as well. |
👍 |
Hi, I've managed to make this feature but with some dirty hacks (from my point of view). Also I'm not very good at styling things so for now this feature looks like this http://nimb.ws/Ykq09X. |
Would be nice to see it land in the next version. 👏 @1099511627776 |
* Probable fix for issue #450 * Removed unused code * Added test components and some styles * fixed eslint warnings * npm run test now runs without errors * fix: support refs lists * test: e2e
@1099511627776 @Akryum when inspecting the component with the
function processRefs (instance) {
if (Object.keys(instance.$refs).length === 0) {
return []
}
console.log(instance.$refs) // the cause of the logging
let refs = Object.keys(instance.$refs).map(key => Object(util["m" /* getCustomRefDetails */])(instance, key, instance.$refs[key]))
return refs.length > 0 ? refs : []
} version 5.0.0.b3
|
It would be nice to be able to inspect
this.$refs
Just like there is
$route
in a component, maybe it could have$refs
below it?The text was updated successfully, but these errors were encountered: