123456789101112131415161718 |
- from nicegui import ui
- def main_demo() -> None:
- json = {
- 'array': [1, 2, 3],
- 'boolean': True,
- 'color': '#82b92c',
- None: None,
- 'number': 123,
- 'object': {'a': 'b', 'c': 'd'},
- 'time': 1575599819000,
- 'string': 'Hello World'
- }
- ui.json_editor({'content': {'json': json}},
- on_select_json=lambda e: ui.notify(f'Select JSON: {e}'),
- on_select_text=lambda e: ui.notify(f'Select text: {e}'),
- on_change=lambda e: ui.notify(f'Change: {e}')).classes('h-80')
|