StippleUI.jl icon indicating copy to clipboard operation
StippleUI.jl copied to clipboard

How to use StippleUI.Dialog as notification

Open szafna opened this issue 3 years ago • 5 comments

Hi,

trying to add a notification (a dialog with OK button) to my Stipple app using Dialog (q-dialog) component. However could not managet to do. Need some help, please.

szafna avatar Aug 29 '21 09:08 szafna

Put a Bool variable in your model and bind it to the dialog. A distilled example could look like this.

@reactive mutable struct Example <: ReactiveModel
    show_dialog::R{Bool} = false
end

function ui(model)
    dialog(fieldname = :show_dialog, card("Here is all the text"))
end

model.show_dialog[] = true

More information on the quasar dialog is found in the quasar docs. Maybe, we will change this component in the future to accept a symbol for the fieldname.

hhaensel avatar Feb 16 '22 20:02 hhaensel

ok, in the next version it will be

julia> dialog(:show_dialog, card("Here is all the text"))
"<q-dialog v-model=\"show_dialog\"><q-card>Here is all the text</q-card></q-dialog>"

hhaensel avatar Feb 16 '22 20:02 hhaensel

It's already in master, together with tooltip() 😉

hhaensel avatar Feb 16 '22 20:02 hhaensel

@szafna does that meet your needs or do you need more information?

hhaensel avatar Nov 14 '23 22:11 hhaensel

Can we close this?

hhaensel avatar Jun 19 '24 22:06 hhaensel