In a template defintion, $refs is not properly updated if no explicit ref is used to reference the element in the component setup
Version
3.2.23
Reproduction link
Steps to reproduce
Open the SFC example.
What is expected?
The tagName of the paragraph should be displayed.
What is actually happening?
It is not displayed.
But when you replace 'false' by 'true', then it is shown, in both cases. Thus, if an explicit ref is used in the component setup then $refs are properly updated in the template definition.
I want to pass references to elements to other components, in order to easily display their bounding boxes.
Just use refTop
directly when using the setup syntax
Sorry but here's another example.
As you can see, the tagName only appears when the component is updated. This seems like a weird behaviour, and people should be at least warned about this in the docs.
@rgaudy You just need to define refTop
and use refTop directly: example