Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Update components-slots.md #2358

wants to merge 1 commit into from

Conversation

ianfabs
Copy link
Contributor

@ianfabs ianfabs commented Oct 22, 2019

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

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) )
Copy link
Member

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.
Copy link
Member

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) )
Copy link
Member

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.
Copy link
Member

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.

Copy link
Member

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:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"currently" isn't necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants