main.py 511 B

1234567891011121314151617
  1. from nicegui import ui
  2. @ui.page('/subpage')
  3. def subpage():
  4. ui.label('This is a subpage')
  5. @ui.page('/')
  6. def index():
  7. with ui.card().classes('mx-auto px-24 pt-12 pb-24 items-center'):
  8. ui.label('this demonstrates hosting of a NiceGUI app on a subpath').classes('text-h5')
  9. ui.label('as you can see the entire app is available below /nicegui but the code here does not need to know that').classes('text-lg')
  10. ui.link('navigate to a subpage', subpage).classes('text-lg')
  11. ui.run()