playground/julia/genie/main.jl

40 lines
709 B
Julia
Raw Normal View History

2024-10-28 10:02:43 -04:00
using GenieFramework
@genietools
@in my_button = false
@in text = "Some text"
@out function1 = jsfunction"""() => console.log("A")"""
@handlers begin
@onchange text begin
println(text)
end
@onchange my_button begin
println("pressed")
end
end
function ui()
c = card([
card_section("This is a section", class="bg-primary text-white")
separator()
card_section("RR")
card_section("{{ text }}")
])
rv = row([
c
btn("A button", @click("my_button = !my_button"))
btn("A button", @click("function1"))
textfield("What is your name?", :text, placeholder="Type some text")
]; class="q-gutter-sm")
println(rv |> string)
return rv
end
@page("/", ui)
Server.isrunning() || Server.up()