Skip to content

[7.x] Add dynamic slot name support#33724

Merged
taylorotwell merged 1 commit into
laravel:7.xfrom
cbl:7.x
Aug 1, 2020
Merged

[7.x] Add dynamic slot name support#33724
taylorotwell merged 1 commit into
laravel:7.xfrom
cbl:7.x

Conversation

@cbl

@cbl cbl commented Aug 1, 2020

Copy link
Copy Markdown
Contributor

This pr adds support for dynamic slot names using the : prefix:

<x-slot :name="$foo">
    {{-- ... --}}
</x-slot>

@GrahamCampbell GrahamCampbell changed the title Add dynamic slot name support [7.x] Add dynamic slot name support Aug 1, 2020
@taylorotwell taylorotwell merged commit 8f70e82 into laravel:7.x Aug 1, 2020
@driesvints

Copy link
Copy Markdown
Member

@cbl good one!

@mnaderian

mnaderian commented Aug 5, 2020

Copy link
Copy Markdown

Should we add it to the main docs as Dynamic Slot Names?

@cbl

cbl commented Aug 5, 2020

Copy link
Copy Markdown
Contributor Author

@mnabialek I think the way it works now is the way you would expect it to work since dynamic attributes on Blade X components work the same way. However it might be useful to read that it is possible when flying over the docs.

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.

4 participants