genie / app.jl
jpbrasile's picture
Update app.jl
1c232cb
raw
history blame contribute delete
596 Bytes
module App
using Stipple
@reactive mutable struct Name <: ReactiveModel
name::R{String} = "World"
end
function ui(model)
page( model, class="container", [
h1([
"Hello "
span("", @text(:name))
" from Genie.jl!"
])
p([
"What is your name? "
input("", placeholder="Type your name", @bind(:name))
])
]
)
end
route("/") do
model = Name |> init
html(ui(model), context = @__MODULE__)
end
end
#up() # or `up(open_browser = true)` to automatically open a browser window/tab when launching the app
#up(open_browser = true)