Skip to content

Commit

Permalink
demonstrate dialog event registration
Browse files Browse the repository at this point in the history
  • Loading branch information
rodja committed Dec 29, 2024
1 parent 09f4c34 commit 5f64a19
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions website/documentation/content/dialog_documentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,18 @@ def replace():
ui.button('Replace', on_click=replace)


@doc.demo('Events', '''
Dialogs emit events when they are opened or closed.
See the [Quasar documentation](https://quasar.dev/vue-components/dialog) for more information.
''')
def events():
with ui.dialog().props('backdrop-filter="blur(8px) brightness(40%)"') as dialog:
ui.label('Press ESC to close').classes('text-3xl text-white')

dialog.on('show', lambda: ui.notify('Dialog opened'))
dialog.on('hide', lambda: ui.notify('Dialog closed'))
dialog.on('escape-key', lambda: ui.notify('ESC pressed'))
ui.button('Open', on_click=dialog.open)


doc.reference(ui.dialog)

0 comments on commit 5f64a19

Please sign in to comment.