-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Update components-slots.md #2358
base: master
Are you sure you want to change the base?
Conversation
Added section detailing the known limitations on slot naming, as suggested by #2295
|
||
The `v-slot:` directive does not currently support names that: | ||
|
||
- Start with a square-bracket character **`[`** ( They may contain square brackets elsewhere, so long as they are not the first character. The reason for this is that Vue reserves this for [Dynamic Slot Names](#Dynamic-Slot-Names) ) |
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.
Why is there a space between (
and The
? :)
The `v-slot:` directive does not currently support names that: | ||
|
||
- Start with a square-bracket character **`[`** ( They may contain square brackets elsewhere, so long as they are not the first character. The reason for this is that Vue reserves this for [Dynamic Slot Names](#Dynamic-Slot-Names) ) | ||
- Contain whitespace. |
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.
a whitespace
?
|
||
The `v-slot:` directive does not currently support names that: | ||
|
||
- Start with a square-bracket character **`[`** ( They may contain square brackets elsewhere, so long as they are not the first character. The reason for this is that Vue reserves this for [Dynamic Slot Names](#Dynamic-Slot-Names) ) |
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.
the square bracket
, not a square-bracket
.
|
||
- Start with a square-bracket character **`[`** ( They may contain square brackets elsewhere, so long as they are not the first character. The reason for this is that Vue reserves this for [Dynamic Slot Names](#Dynamic-Slot-Names) ) | ||
- Contain whitespace. | ||
- Contain special characters used by directive-atributes like `.` in the name for a scoped-slot; Vue will treat this as a directive modifier. |
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.
directive attributes
, not directive-atributes
.
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.
Actually I believe you can just copy what @NataliaTepluhina wrote in the linked issue for this whole bullet point.
@@ -223,6 +223,14 @@ Either way, the rendered HTML will be: | |||
|
|||
Note that **`v-slot` can only be added to a `<template>`** (with [one exception](#Abbreviated-Syntax-for-Lone-Default-Slots)), unlike the deprecated [`slot` attribute](#Deprecated-Syntax). | |||
|
|||
### Slot Naming Limitations | |||
|
|||
The `v-slot:` directive does not currently support names 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.
"currently" isn't necessary.
Added section detailing the known limitations on slot naming, as suggested by #2295 . I also included an explanation for the inability to start your slot names with a square-bracket character, and that it is because Vue reserves this for Dynamic Slot Naming