1
0

main.py 394 B

12345678910111213141516171819
  1. #!/usr/bin/env python3
  2. from nicegui import ui
  3. from counter import Counter
  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 value: message.set_text(f'The value changed to {value}.'))
  10. ui.button('Reset', on_click=lambda: counter.reset()).props('small outline')
  11. message = ui.label()
  12. ui.run()