-
Notifications
You must be signed in to change notification settings - Fork 4.8k
docs: document mixing named and default slots #1946
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
Conversation
✅ Deploy Preview for vuejs ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
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.
Thanks for the PR!
I think there may be a couple of problems with explaining it this way:
- It appears to contradict the example that immediately precedes it, which mixes named slots and the default slot quite happily, without using
#default
. The problem only occurs whenv-slot
/#default
is explicitly used on the parent tag. If it is omitted then everything works fine. - This new example is using a scoped slot before the concept of scoped slot has been introduced.
I think we may need to move this explanation further down, because scoped slots are the key reason why somebody would run into this problem in the first place. Maybe in the section about Named Scoped Slots?
That's what I did in my first commit, I finally decided to move it earlier after mixing the slots. I'll do that ! |
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've made some suggestions below. Let me know if anything isn't clear or if you have any questions. Thanks.
Co-authored-by: skirtle <[email protected]>
Co-authored-by: skirtle <[email protected]>
Co-authored-by: skirtle <[email protected]>
Co-authored-by: skirtle <[email protected]>
@skirtles-code it's totally clear, I used your suggestions. |
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.
Looks good to me!
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.
@noook thank you for the contribution and thanks to @skirtles-code for the detailed review! PR looks good to me, let's get it merged
vuejs/core#6549
Description of Problem
Regarding this issue, the compiler doesn't inform what's the real problem with mixing named slot and default. This PR updates the documentation to explain how to avoid this error. The compiler error still needs to be clearer.
Proposed Solution
Provide an example on how to use default slots along named slots
Additional Information
—