example_c.py 537 B

123456789101112131415161718192021
  1. import theme
  2. from message import message
  3. from nicegui import APIRouter, ui
  4. router = APIRouter(prefix='/c')
  5. @router.page('/')
  6. def example_page():
  7. with theme.frame('- Example C -'):
  8. message('Example C')
  9. for i in range(1, 4):
  10. ui.link(f'Item {i}', f'/c/items/{i}').classes('text-xl text-grey-8')
  11. @router.page('/items/{id}', dark=True)
  12. def item(id: str):
  13. with theme.frame(f'- Example C{id} -'):
  14. message(f'Item #{id}')
  15. ui.link('go back', router.prefix).classes('text-xl text-grey-8')