Replies: 2 comments
-
I'm unsure if I follow. I'll suggest something and you tell me if I'm close or not. AFAIK, layout components can only have the As for your example, it makes me wonder: What makes the 3 parts change (left menu, right menu and main content? If it is the route, you should be doing nested If this still doesn't satisfy your need, then I would suggest you simply let the contents of the layout's |
Beta Was this translation helpful? Give feedback.
-
Yes and some context from the docs: As an authoring convenience, snippets declared directly inside a component implicitly become props on the component. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I hope to insert multiple different components into the specified {@render} of the upper layout at different routing sub-levels. Since I don’t know a simple way to pass these components to the default children props, my requirement is actually As the title of this question suggests, named slots are used in layouts. I currently use the following code to solve the needs, but I intuitively think that my way is bad and very circuitous, and I do not need to dynamically change the inserted components after loading the page, but I use additional code in order to pass these snippets The writable store and Context methods are added.
Hopefully someone can give me a better idea for my current approach, maybe there should be a direct way to pass props in the +page.svelte html area, but I can't find it.
In addition, when I use this method, I will receive a warning on the browser
[svelte] invalid_raw_snippet_renderThe
renderfunction passed to
createRawSnippetshould return HTML for a single element
Beta Was this translation helpful? Give feedback.
All reactions