S
Solara5mo ago
izumi.qu

is there a demo or best enviroment

is there a demo or best enviroment setting for jupyterlab with routes or layout? i try to print some info but got nothing... import solara 导入您的页面组件 from Module.P_BILI import app as P_BILI_Page from Module.P_GPTOrder import app as P_GPTOrder_Page from scripts import DailyRecorder as P_StatusRecord from scripts import LoopRecorder as P_LoopRecord 定义路由 routes = [ solara.Route(path="/", component=P_LoopRecord.Page, label="P_Status"), solara.Route(path="p_DailyRecord", component=P_StatusRecord.Page, label="p_DailyRecord"), solara.Route(path="p_BILI", component=P_BILI_Page.Page, label="P_BILI Home"), solara.Route(path="p_gptorder", component=P_GPTOrder_Page.Page, label="P_GPTOrder Page"), ] @solara.component def Page(): level = solara.use_route_level() # returns 0 route_current1= solara.use_router() route_current, routes_current_level = solara.use_route() print(level,route_current1.path,route_current,routes_current_level) return P_LoopRecord.Page()
@solara.component def Layout(children): route, routes = solara.use_route() print(route,routes) dark_effective = solara.lab.use_dark_effective() return solara.AppLayout(children=children, toolbar_dark=dark_effective, color=None) # if dark_effective else "primary")
Layout([Page()]) the result None [] 3 None []
3 Replies
MaartenBreddels
MaartenBreddels5mo ago
routes/navigation is not supported in lab
izumi.qu
izumi.quOP5mo ago
what else way can I use for testing multipage and layout?
MaartenBreddels
MaartenBreddels5mo ago
with solara server solara run <script>
Want results from more Discord servers?
Add your server