example_c.py 573 B

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