You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe. 🤔
Now that buildHtml can generate fragments of DSL code, the next natural thing to do with them is to place them in more complex data structures other than simple assignments. Procs returning TagRefs and seqs/sets/tables of TagRefs are all valuable, but if simplicity is a priority, then simply having a convenient way to de-reference children would be enough.
Given that components can only have one slot, for example, accessing the children of slot allows components to have a variable number of TagRef arguments and post them to the page in more selective and complex ways.
Currently we can access children and assign to a variable, but cannot use [] directly to place a TagRef:
appRoutes("ROOT"):
"/":
let myList = buildHtml:
tDiv: "a"
tDiv: "b"
tDiv: "c"
let myItem = myList.children[2]
myItem
# myList.children[2]
The code will run and selects tDiv: "c", but the commented code fails. Currently the compiler says it expected an identifier but didn't get one; ideally it seems we want to allow any call that returns a static string or a Component or a TagRef
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe. 🤔
Now that
buildHtml
can generate fragments of DSL code, the next natural thing to do with them is to place them in more complex data structures other than simple assignments. Procs returningTagRefs
and seqs/sets/tables ofTagRefs
are all valuable, but if simplicity is a priority, then simply having a convenient way to de-reference children would be enough.Given that components can only have one slot, for example, accessing the children of slot allows components to have a variable number of
TagRef
arguments and post them to the page in more selective and complex ways.Currently we can access children and assign to a variable, but cannot use
[]
directly to place aTagRef
:The code will run and selects
tDiv: "c"
, but the commented code fails. Currently the compiler says it expected an identifier but didn't get one; ideally it seems we want to allow any call that returns astatic string
or aComponent
or aTagRef
The text was updated successfully, but these errors were encountered: