-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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(runtime-core): modify the patchFlag
of the label containing the ref attribute
#9240
Conversation
Size ReportBundles
Usages
|
80a2c6b
to
5bc5981
Compare
5bc5981
to
0bdfa66
Compare
v-for
patchFlag
of the label containing the ref attribute
1d323c9
to
27168fa
Compare
@@ -597,6 +597,7 @@ export function buildProps( | |||
} | |||
|
|||
if (isVBind && isStaticArgOf(arg, 'ref') && context.scopes.vFor > 0) { | |||
hasRef = true |
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.
@@ -747,7 +748,7 @@ export function buildProps( | |||
} | |||
} | |||
if ( | |||
!shouldUseBlock && | |||
!(shouldUseBlock && !hasRef) && |
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.
I'm unclear why hasRef
has been singled out for special treatment. Two lines down from here, we check for hasRef || hasVnodeHook || runtimeDirectives.length > 0
. Don't we have the same problem for hasVnodeHook
and runtimeDirectives.length > 0
?
- VNode hook example: SFC Playground
- Runtime directive example: SFC Playground
In both cases, the key
seems to prevent unmounted
being triggered.
Resolved in #11682 |
fixed #9239