main.py 352 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 e: ui.notify(f'The value changed to {e.args}.'))
  10. ui.button('Reset', on_click=counter.reset).props('small outline')
  11. ui.run()