resolve_route
Resolve a relative path or a route to an absolute path.
def resolve_path(path_or_route: Union[str, solara.Route], level=0) -> str:
...
If the path is a string and starts with a /'
, it is returned as is.
Typical usage:
...
route_current, routes_current_level = solara.routes()
# route_current.path == "banana"
path = solara.resolve_path(route_current)
# path == "/fruit/banana"
path_same = solara.resolve_path("banana")
# path_same == path == "/fruit/banana"
...
Arguments
- path_or_route: a path string or a
solara.Route
object to resolve.
See also
Example
Click on one of the links below to change the route and see the url in your browser change, and match the text.