Treat layout pages like components when using named slots
Let's say I have a `_layout.svelte` like the following: ```html <slot name="layout-pre"></slot> <div id="intermediate">Some other intermediate stuff.</div> <slot></slot> ``` And now I have a child view (let's call it `homepage.svelte` which inherits that layout, which puts some stuff into the named slot, and the rest into the default slot: ```html <h1 slot="layout-pre">This should come before #intermediate.</h1> <!-- When rendered, the div from above should get inserted here from the layout: <div id="intermediate">Some other intermediate stuff.</div> --> <main>Since this doesn't use a named slot, it'll just get inserted into the unnamed slot above.</main> ``` Right now this is not allowed, and the following error is thrown: `Element with a slot='...' attribute must be a descendant of a component or custom element`. Are there technical or usage reasons why we wouldn't want to treat a layout like any other component with respect to slots?
Posted by Aias on Sep 5, 2019, 9:05 AM
Tags
Related issues
- struct's lifetime requirements can be bypassed via covariant field assignment
- Proposal to Reorganize the Moderation Team and Review Moderation Policies
- Progressive FPS degradation appears to be related to dota2.com — blocking the domain prevents the performance loss
- proposal: container/...: generic collection types
- Better Custom Endpoint BYOK
- A concrete policy for backward compatibility until Godot 5.0
Raise real-world problems, find people facing the same issue, and discuss solutions.3,500 issues0 comments
github (Other)
struct's lifetime requirements can be bypassed via covariant field assignment
Proposal to Reorganize the Moderation Team and Review Moderation Policies
Progressive FPS degradation appears to be related to dota2.com — blocking the domain prevents the performance loss
proposal: container/...: generic collection types
Better Custom Endpoint BYOK
A concrete policy for backward compatibility until Godot 5.0
New MTP models not supported
Tracking: 429 / Capacity Issues
Treat layout pages like components when using named slots
Let's say I have a `_layout.svelte` like the following: ```html <slot name="layout-pre"></slot> <div id="intermediate">Some other intermediate stuff.</div> <slot></slot> ``` And now I have a child view (let's call it `homepage.svelte` which inherits that layout, which puts some stuff into the named slot, and the rest into the default slot: ```html <h1 slot="layout-pre">This should come before #intermediate.</h1> <!-- When rendered, the div from above should get inserted here from the layout: <div id="intermediate">Some other intermediate stuff.</div> --> <main>Since this doesn't use a named slot, it'll just get inserted into the unnamed slot above.</main> ``` Right now this is not allowed, and the following error is thrown: `Element with a slot='...' attribute must be a descendant of a component or custom element`. Are there technical or usage reasons why we wouldn't want to treat a layout like any other component with respect to slots?
Comments (0)
No comments yet. Start the discussion.