Skip to content
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

VNodes' refs are discarded when passed to <component :is="vnodes" ref="custom" /> #2078

Closed
posva opened this issue Sep 9, 2020 · 4 comments

Comments

@posva
Copy link
Member

posva commented Sep 9, 2020

Version

3.0.0-rc.10

Reproduction link

https://jsfiddle.net/mxv2r4gh/

Steps to reproduce

  • click the button

What is expected?

The watcher on viewRef should trigger

What is actually happening?

viewRef doesn't change


From vuejs/router#461

@CyberAP
Copy link
Contributor

CyberAP commented Sep 9, 2020

It works for a :ref binding though.

@posva
Copy link
Member Author

posva commented Sep 11, 2020

@CyberAP Can you post the whole code you used? It doesn't seem to work

@CyberAP
Copy link
Contributor

CyberAP commented Sep 11, 2020

The only line I changed was this:

<component :is="Component" ref="custom" />

To this:

<component :is="Component" :ref="custom" />

Do note that console.log(value.$el) takes a lot of time in JSFiddle because it prints that object in its own console. If you just log 1 it will work as expected.

@posva
Copy link
Member Author

posva commented Sep 11, 2020

That won't work for custom ref though, it's like omitting the ref attribute

@github-actions github-actions bot locked and limited conversation to collaborators Nov 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants