|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
from h2o_wave import main, app, Q, ui |
|
|
|
|
|
@app('/demo') |
|
async def serve(q: Q): |
|
blurb_items = [ui.button(name='#submenu', label='Go to submenu', link=True)] |
|
blurb_title = 'Welcome to Menu' |
|
breadcrumbs = [ui.breadcrumb(name='#menu', label='Menu')] |
|
|
|
if q.args['#'] == 'menu': |
|
blurb_items = [ui.button(name='#submenu', label='Go to submenu', link=True)] |
|
blurb_title = 'Welcome to Menu!' |
|
breadcrumbs = [ |
|
ui.breadcrumb(name='#menu', label='Menu'), |
|
] |
|
elif q.args['#'] == 'submenu': |
|
blurb_items = [ui.button(name='#subsubmenu', label='Go to subsubmenu', link=True)] |
|
blurb_title = 'Welcome to Submenu!' |
|
breadcrumbs = [ |
|
ui.breadcrumb(name='#menu', label='Menu'), |
|
ui.breadcrumb(name='#submenu', label='Submenu'), |
|
] |
|
elif q.args['#'] == 'subsubmenu': |
|
blurb_items = [ui.text('You cannot go deeper, click on Breadcrumbs above to navigate back')] |
|
blurb_title = 'Welcome to Subsubmenu!' |
|
breadcrumbs = [ |
|
ui.breadcrumb(name='#menu', label='Menu'), |
|
ui.breadcrumb(name='#submenu', label='Submenu'), |
|
ui.breadcrumb(name='#subsubmenu', label='Subsubmenu'), |
|
] |
|
|
|
q.page['blurb'] = ui.form_card(box='1 2 3 2', title=blurb_title, items=blurb_items) |
|
q.page['breadcrumbs'] = ui.breadcrumbs_card(box='1 1 3 1', items=breadcrumbs) |
|
|
|
await q.page.save() |
|
|