|
@@ -48,4 +48,18 @@ def replace_content():
|
|
ui.button('Replace', on_click=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)
|
|
doc.reference(ui.dialog)
|