-
Notifications
You must be signed in to change notification settings - Fork 141
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: when defining routes top level in a script, ignore main component
- Loading branch information
1 parent
61f6d64
commit df40333
Showing
4 changed files
with
118 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import solara | ||
|
||
|
||
@solara.component | ||
def Page1(): | ||
solara.Text("Page 1") | ||
|
||
|
||
@solara.component | ||
def Page2(): | ||
solara.Text("Page 2") | ||
|
||
|
||
@solara.component | ||
def Layout(children): | ||
with solara.AppLayout(): | ||
with solara.Column(): | ||
solara.Text("Custom layout") | ||
solara.display(*children) | ||
|
||
|
||
routes = [ | ||
solara.Route("/", component=Page1, layout=Layout), | ||
solara.Route("page2", component=Page2), | ||
] |