Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use StippleUI.Dialog as notification #29

Open
szafna opened this issue Aug 29, 2021 · 5 comments
Open

How to use StippleUI.Dialog as notification #29

szafna opened this issue Aug 29, 2021 · 5 comments

Comments

@szafna
Copy link

szafna commented Aug 29, 2021

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.

@hhaensel
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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

@hhaensel
Copy link
Member

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

@hhaensel
Copy link
Member

Can we close this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants