render

fun render(selector: String, override: Boolean = true, scope: ScopeContext.() -> Unit = {}, content: RenderContext.() -> Unit)

Creates a RenderContext for Tags and mounts it to a constant element in the static html file which id matches the selector.

Parameters

selector

query selector of the element to mount to

override

if true all child elements are removed before rendering

scope

scope for tag

content

RenderContext for rendering the data to the DOM

Throws

if target element with selector not found


fun render(targetElement: HTMLElement? = document.body, override: Boolean = true, scope: ScopeContext.() -> Unit = {}, content: RenderContext.() -> Unit)

Creates a RenderContext for Tags and mounts it to a targetElement.

Parameters

targetElement

HTMLElement to mount to, default is document.body

override

if true all child elements are removed before rendering

content

RenderContext for rendering the data to the DOM

scope

scope for tag

Throws