feat: Elements as children

This commit is contained in:
DavidOnTop 2024-09-20 22:20:35 +02:00
parent ff2ec88fcf
commit 6515854b30
No known key found for this signature in database
GPG key ID: 5D05538A45D5149F
2 changed files with 3 additions and 3 deletions

View file

@ -6,5 +6,5 @@ import top.davidon.sfs.dom.tags.Tag
class Element[+Ref <: org.scalajs.dom.Element](
val tag: Tag[Ref],
val mods: Iterable[Modifier[?, ?]],
val value: Value[?, String]
val children: Seq[Element[?] | Value[?, String]]
) {}

View file

@ -10,8 +10,8 @@ trait Tag[+Ref <: dom.Element] {
def apply(
modifiers: Modifier[?, ?]*
)(
values: Value[?, String]*
values: Element[?] | Value[?, String]*
): Element[Ref] = {
Element[Ref](this, modifiers, Value.join(values))
Element[Ref](this, modifiers, values.toSeq)
}
}