- Notifications
You must be signed in to change notification settings - Fork5k
Try to improve Dynamic Slot Names documentation#3038
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Propose explanation on how to declare Dynamic Slot Names and not only on how to use them.
netlifybot commentedSep 26, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
✅ Deploy Preview forvuejs ready!
To edit notification comments on pull requests, go to yourNetlify site configuration. |
| </ChildComponent> | ||
| </template> | ||
| <script setup> |
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.
suggestion: we need to wrap this in<div></div> and write the matching code for Options API
| <script setup> | ||
| import ChildComponent from './ChildComponent.vue'; | ||
| const slotNames = ['header', 'footer']; |
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.
Same note as above about the Options API
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 theDynamic Slot Names section of the Vue.js documentation by providing explanations and examples on how todeclare dynamic slots in child components, not just how to use them in parent components.
Description of Problem
The current documentation forDynamic Slot Names focuses primarily on how to use dynamic slot names in theparent component using
v-slotwith dynamic arguments. It lacks information on how todeclare dynamic slots in thechild component. This omission can lead to confusion, as understanding both declaration and usage is essential for implementing dynamic slots effectively.Proposed Solution
:namebinding on the<slot>element.<script setup>and the Composition API to align with modern Vue.js practices.Additional Information