Genie Discord forum
yakir12
10/12/2023, 3:08:58 PMI absolutely love the ease of the notify(model, message)
function!
Is there a way to have messages that contain multiple lines? I tried \n
, <br>
, and others, but the notification is displayed with only one line. I'll add that even the multi-line example in https://quasar.dev/quasar-plugins/notify/#multiline doesn't really work... So not sure what I can hope for...
Pere
10/13/2023, 6:33:55 AMI haven't tried this one yet..can you share a minimum example?
yakir12
10/13/2023, 6:48:29 AMSure! Here:
using GenieFramework
@genietools
const msg = """
This is a
notification with
multiple lines
of text.
"""
@app MWE begin
@in notifyme = false
@onchange notifyme notify(model, msg)
end myhandlers
global model = init(MWE, debounce = 0) |> myhandlers
ui() = [button("Notify me", @click("notifyme = !notifyme"))]
route("/") do
page(model, ui) |> html
end
up()
Rafael
10/13/2023, 11:45:41 AMIn quasar one option this:
Rafael
10/13/2023, 11:46:06 AMusing GenieFramework
@genietools
msg = "Lorem ipsum dolor sit amet, consectetur adipisicing elit. Hic quisquam non ad sit assumenda consequuntur esse inventore officia. Corrupti reiciendis impedit vel, fugit odit quisquam quae porro exercitationem eveniet quasi."
@app MWE begin
@in notifyme = false
@onchange notifyme notify(model, msg; multiLine= true)
end myhandlers
global model = init(MWE, debounce = 0) |> myhandlers
ui() = [button("Notify me", @click("notifyme = !notifyme"))]
route("/") do
page(model, ui) |> html
end
up()```
Rafael
10/13/2023, 11:50:47 AMOption2:
Rafael
10/13/2023, 11:51:00 AM
@genietools
msg = """
<p><strong>This is a
notification</strong></p> <p>with
multiple lines
of text.</p>
"""
@app MWE begin
@in notifyme = false
@onchange notifyme notify(model, msg; html= true)
end myhandlers
global model = init(MWE, debounce = 0) |> myhandlers
ui() = [button("Notify me", @click("notifyme = !notifyme"))]
route("/") do
page(model, ui) |> html
end
up()```
yakir12
10/13/2023, 12:12:12 PMOption 2 works as expected: I want to control where the line breaks are, and adding \n
to option 1 didn't do the trick (for me).
Thanks!