Try to improve Dynamic Slot Names documentation #3038
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.
Sure! Here's a suggested pull request message that you can use:
Title: Improve Documentation for Dynamic Slot Names by Adding Declaration Examples
Description:
This pull request enhances the Dynamic Slot Names section of the Vue.js documentation by providing explanations and examples on how to declare dynamic slots in child components, not just how to use them in parent components.
Description of Problem
The current documentation for Dynamic Slot Names focuses primarily on how to use dynamic slot names in the parent component using
v-slot
with dynamic arguments. It lacks information on how to declare dynamic slots in the child component. This omission can lead to confusion, as understanding both declaration and usage is essential for implementing dynamic slots effectively.Proposed Solution
:name
binding on the<slot>
element.<script setup>
and the Composition API to align with modern Vue.js practices.Additional Information