-
Notifications
You must be signed in to change notification settings - Fork 3
Description
About mixins
The @mixin macro is used to extend the ReactiveModel behind a page with fields from another struct, as you've already done.
It's like what Mixers.jl does, but with some improvements for Stipple as introduced in this issue.
One caveat is that @mixins only works with named models, those created with @app ModelName begin .... We've open an issue on this.
Are @in and @out conventions?
@in variables can be read and written from the UI, whereas @out can only be read. Here's an example:
using GenieFramework
@genietools
@app begin
@in textin = ""
@out textout = ""
@onchange textin begin
@show textin
end
@onchange textout begin
@show textout
end
end
function ui()
[textfield("readwrite", :textin), textfield("readonly", :textout)]
end
@page("", ui)
The textout handler is never triggered as textout is not writeable.
Can we use @page with an existing model?
I don't think this is possible at the moment. We did something similar in the workshop to include multiple pages, but you need to pass the entire module:
@page("/eda", "app/EDA/ui.jl", "layout.jl", Main.App.EDA)
@page("/ml", "app/ML/ui.jl", "layout.jl", Main.App.ML)This would be an useful improvement to the API in order to make working with multiple ReactiveModel in a page easier.
Is there a way to make a loading screen? isprocessing is not working
You can use the q-inner-loading component. There's also a loading option for buttons.
using GenieFramework
@genietools
@app begin
@in disable = false
@onbutton disable begin
println("button disabled")
sleep(5)
end
end
function ui()
[h1("Header"),
btn("Disable", @click("disable = true"), loading=:disable),
quasar(:inner__loading, showing=:disable)]
end
@page("", ui)