|
@@ -395,6 +395,15 @@ with example(ui.page):
|
|
|
|
|
|
ui.link('Visit other page', '/other_page')
|
|
|
|
|
|
+
|
|
|
+with example(ui.open):
|
|
|
+ with ui.page('/yet_another_page') as other:
|
|
|
+ ui.label('Welcome to yet another page')
|
|
|
+ ui.button('RETURN', on_click=lambda e: ui.open('/', e.socket))
|
|
|
+
|
|
|
+ ui.button('REDIRECT', on_click=lambda e: ui.open('/yet_another_page', e.socket))
|
|
|
+
|
|
|
+
|
|
|
add_route = """### Route
|
|
|
|
|
|
Add a new route by calling `ui.add_route` with a starlette route including a path and a function to be called.
|
|
@@ -447,11 +456,4 @@ with example(ui.keyboard):
|
|
|
ui.label('Key events can be caught globally by using the keyboard element.')
|
|
|
ui.checkbox('Track key events').bind_value_to(keyboard, 'active')
|
|
|
|
|
|
-with example(ui.open):
|
|
|
- with ui.page('/yet_another_page') as other:
|
|
|
- ui.label('Welcome to yet another page')
|
|
|
- ui.button('RETURN', on_click=lambda e: ui.open('/', e.socket))
|
|
|
-
|
|
|
- ui.button('REDIRECT', on_click=lambda e: ui.open('/yet_another_page', e.socket))
|
|
|
-
|
|
|
-ui.run(port=8080)
|
|
|
+ui.run()
|