File size: 596 Bytes
d079215 1c232cb |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
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) |