pywebio / PyWebIO

Write interactive web app in script way.
https://pywebio.readthedocs.io
MIT License
4.49k stars 384 forks source link

[Feature Request]put_tabs #604

Closed StarsExpress closed 1 year ago

StarsExpress commented 1 year ago

For put_tabs, is it possible to put scopes of tables inside each tab, and update table values if needed?

wang0618 commented 1 year ago

Yes, you can, use put_scope(name) to put a scope just like ordinary output:

put_tabs([
    {'title': 'tab1', 'content': put_scope('t1')},
    {'title': 'tab2', 'content': put_scope('t2')},
    {'title': 'tab3', 'content': put_scope('t3')},
])

Then you can use use_scope() to update the content of the scope