Replies: 1 comment 1 reply
-
Funnily enough I just pointed you at some hints on the Go Discord channel. Have a look at my playground repo, https://github.com/pharrisee/stove especialy the web folder for ideas on how things can be built as components. I don't think it answers you completely but it might raise some ideas on how it might be done. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Coming from other template engines it's often possible to have multiple slots. The closest equivalent I could find in is
children
.Specifically, this example:
Imagine you have a
layout
component and a detail view for anitem
. For the detail view to work, additional JavaScript is required, you'd usually load it in<head>
. But I don't see how to do that, as there are no namedchildren
slots. You'd need something like this:Here, the
children1
slot would be used for inserting additional scripts in the<head>
, whilechildren2
would contain content for the body of the layout. This structure allows more control over where different pieces of content are injected, similar to what other template engines might offer with named slots.Beta Was this translation helpful? Give feedback.
All reactions