Closed
Description
Description
I want to place the Log component in the tab, everything is OK, but to see the logs, you first need to switch to the Log viewer tab
from datetime import datetime
from nicegui import ui
with ui.row():
with ui.tabs().classes('w-full').props(add="dense align=left") as tabs:
one = ui.tab('Something')
logs = ui.tab('Logs')
ui.separator()
with ui.tab_panels(tabs, value=one).classes('w-full').style('min-height: 268px'):
with ui.tab_panel(one):
ui.image('https://picsum.photos/id/377/640/360').style('max-width: 420px')
with ui.tab_panel(logs):
log = ui.log(max_lines=10).classes('w-full h-20')
with ui.row():
ui.button('Log time', on_click=lambda: log.push(datetime.now().strftime('%X.%f')[:-5]))
ui.run()
In this example:
- run
- click on "Log time" button
- switch to the "Logs" tab - no entries here
- click again
- enties are visible