fix(runtime-core): prevent readonly warning when using useTemplateRef with same variable name as template ref#11802
Closed
jh-leong wants to merge 1 commit intovuejs:mainfrom
Closed
fix(runtime-core): prevent readonly warning when using useTemplateRef with same variable name as template ref#11802jh-leong wants to merge 1 commit intovuejs:mainfrom
useTemplateRef with same variable name as template ref#11802jh-leong wants to merge 1 commit intovuejs:mainfrom
Conversation
…f` with same variable name as template ref
Size ReportBundles
Usages
|
@vue/compiler-dom
@vue/compiler-core
@vue/compiler-ssr
@vue/compiler-sfc
@vue/reactivity
@vue/runtime-dom
@vue/runtime-core
@vue/shared
@vue/server-renderer
vue
@vue/compat
commit: |
Member
|
If this is the case, Vue will still throw a warning I think we should check if it's a templateRef when setRef, but since vue has unref'd the templateRef, we can't determine it anymore |
Member
Author
Good catch @linzhe141 ! However, for this edge case, maybe we could show a warning at compile time (as edison1105 suggested) or let the language tool handle it with a TypeScript error. In fact, the latest version of the language tool already provides warnings for such cases. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
close #11795