Genie Discord forum

Author Avataryakir12
10/12/2023, 3:08:58 PM

I 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...

Author AvatarPere
10/13/2023, 6:33:55 AM

I haven't tried this one yet..can you share a minimum example?

Author Avataryakir12
10/13/2023, 6:48:29 AM

Sure! 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()
Author AvatarRafael
10/13/2023, 11:45:41 AM

In quasar one option this:

Author AvatarRafael
10/13/2023, 11:46:06 AM
using 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()```
Author AvatarRafael
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()```
Author Avataryakir12
10/13/2023, 12:12:12 PM

Option 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!