x-slot
's inside x-slot
& support multiple x-slot
arrays without hardcoded the slot's name
#45319
Unanswered
bayukartiko
asked this question in
Ideas
Replies: 1 comment
-
Hey, Did you ever find a solution for this? I am currently trying to build a context-menu component and it would be nice to use named slots instead of creating a new component just for the content inside. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello there!,
I have a case of using bootstrap accordion, the basic bootstrap accordion according the documentation is like this: https://getbootstrap.com/docs/5.2/components/accordion
now in my blade at least like this:
Unfortunately, multiple arrays of
x-slot
names doesn't allowed. like this:You have to manually hardcoded the slot name instead:
or like this answers via: https://laracasts.com/discuss/channels/general-discussion/blade-dynamic-component-dynamic-named-slots?page=1&replyId=646487
I think it would be a nice way to make the code a bit easier without manually hardcoded the name again if I want to add more items inside the accordion.
Unfortunately,
x-slot
's insidex-slot
doesn't allowed. this sample code below will not be detected as a slot or as plain HTML instead.sample like this:
I think it would be a great approach if
x-slot
's insidex-slot
and multiple arrays ofx-slot
names can be PR to laravel 9.x or 10.x maybe,I'll appreciate it if this ideas have various suggestions from you all, and it will be a lot of improvement of this idea and the laravel framework of course.
Beta Was this translation helpful? Give feedback.
All reactions