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

fix(compiler-sfc): fix dynamic template ref in inline template #4892

Closed
wants to merge 1 commit into from

Conversation

Bigfish8
Copy link
Contributor

@Bigfish8 Bigfish8 commented Nov 3, 2021

fix #4866

@ygj6
Copy link
Member

ygj6 commented Nov 3, 2021

The problem with this approach is that we can't set the old value to null when unloading the ref.:worried:
eg: sfc.vuejs.org/
When you switch from HomeView to PostsView, Home_View is not set to null.

@Bigfish8
Copy link
Contributor Author

Bigfish8 commented Nov 4, 2021

Yes, you are right.
Notice that in this case,the component is keep-alive.I think the dynamic ref provides the way for users to access different component instance.Maybe it is the only condition?
If the user wants to access only one ref, ref is enough.Like this:
<component :is="currentTabComponent" ref="currentTabRef"></component>🤔

@Bigfish8 Bigfish8 closed this Nov 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

项目编译后,component标签上ref属性对应的响应式对象为空,开发环境下正常
2 participants