main.py 368 B

1234567891011121314151617
  1. #!/usr/bin/env python3
  2. from counter import Counter
  3. from nicegui import ui
  4. ui.markdown('''
  5. #### Try the new click counter!
  6. Click to increment its value.
  7. ''')
  8. with ui.card():
  9. counter = Counter('Clicks', on_change=lambda msg: ui.notify(f'The value changed to {msg["args"]}.'))
  10. ui.button('Reset', on_click=counter.reset).props('small outline')
  11. ui.run(port=1234)