-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(slots): properly force update on forwarded slots
fix #1594
- Loading branch information
Showing
7 changed files
with
99 additions
and
22 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
export const enum SlotFlags { | ||
/** | ||
* Stable slots that only reference slot props or context state. The slot | ||
* can fully capture its own dependencies so when passed down the parent won't | ||
* need to force the child to update. | ||
*/ | ||
STABLE = 1, | ||
/** | ||
* Slots that reference scope variables (v-for or an outer slot prop), or | ||
* has conditional structure (v-if, v-for). The parent will need to force | ||
* the child to update because the slot does not fully capture its dependencies. | ||
*/ | ||
DYNAMIC = 2, | ||
/** | ||
* <slot/> being forwarded into a child component. Whether the parent needs | ||
* to update the child is dependent on what kind of slots the parent itself | ||
* received. This has to be refined at runtime, when the child's vnode | ||
* is being created (in `normalizeChildren`) | ||
*/ | ||
FORWARDED = 3 | ||
} |
aab99ab
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.
/cc @HcySunYang @Amour1688