1
0

main.py 542 B

12345678910111213141516
  1. #!/usr/bin/env python3
  2. from counter import Counter
  3. from on_off import OnOff
  4. from nicegui import ui
  5. with ui.row(align_items='center'):
  6. counter = Counter('Count', on_change=lambda e: ui.notify(f'The value changed to {e.args}.'))
  7. ui.button('Reset', on_click=counter.reset).props('outline')
  8. with ui.row(align_items='center'):
  9. on_off = OnOff('State', on_change=lambda e: ui.notify(f'The value changed to {e.args}.'))
  10. ui.button('Reset', on_click=on_off.reset).props('outline')
  11. ui.run(uvicorn_reload_includes='*.py,*.js,*.vue')