-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
fix(runtime-core): modify the patchFlag
of the label containing the ref attribute
#9240
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -597,6 +597,7 @@ export function buildProps( | |
} | ||
|
||
if (isVBind && isStaticArgOf(arg, 'ref') && context.scopes.vFor > 0) { | ||
hasRef = true | ||
properties.push( | ||
createObjectProperty( | ||
createSimpleExpression('ref_for', true), | ||
|
@@ -747,7 +748,7 @@ export function buildProps( | |
} | ||
} | ||
if ( | ||
!shouldUseBlock && | ||
!(shouldUseBlock && !hasRef) && | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm unclear why
In both cases, the |
||
(patchFlag === 0 || patchFlag === PatchFlags.HYDRATE_EVENTS) && | ||
(hasRef || hasVnodeHook || runtimeDirectives.length > 0) | ||
) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests all seem to pass even if this line is omitted. Perhaps there should be another test case added to cover this scenario too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is to address the issue at #9239 (comment), the function cannot be resolved in compile so I can't add a unit test for it.