-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Added slot to todo list component #763
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
Added slot to todo list component to emphasize the fact that you can replace the content with custom content. As the sentence states, this won't work without scoped slots.
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.
Sorry for the delay in getting back to you.
I agree that the current wording is confusing. I think adding a <slot>
does fix one source of confusion but I fear it may introduce a new one. In general, I think we should try to avoid having examples of code that doesn't work, as I think readers can easily get lost that way. Sometimes it's necessarily to illustrate a point but I think we may be able to find an alternative here.
Perhaps the sentence that follows this example could be reworded to something like this:
We might want to replace the `{{ item }}` with a `<slot>` to customize it on parent component:
What do you think? Would that have made it clearer for you?
I've made a change recommended with @skirtles-code 👍🏻 |
Hey Yes, I think that will do it. Why would |
@NataliaTepluhina @hitautodestruct there is a problem with this change — |
@Alex-Sokolov What if we remove the spaces around item making it |
@Alex-Sokolov I'll put in a PR shortly to fix that. VuePress interprets template syntax in inline code so it needs escaping. Something similar was required to document the |
@hitautodestruct Yes, you're correct it would. Describing it as 'code that doesn't work' wasn't ideal wording on my part. But you'd end up with the exact same content for each of the items, so in practice it wouldn't be a useful I think the intention of that section is to start with an example that doesn't use slots at all and introduce a working scoped slot. The sentence you highlighted originally was confusing but that's now changed. Had we introduced a |
Added slot to todo list component to emphasize the fact that you can replace the content with custom content.
As the sentence states, this won't work without scoped slots.
Description of Problem
The code does not make sense for the sentence that follows it:
Proposed Solution
Added
<slot>
wrapper to emphasize that there is a slot to customizeAdditional Information
I had to read this example a few times to understand which slot is being customized in order to understand.