yew-router
: Allow matching path segments
#2429
-
Allow matching path segments with routes. The following doesn't work because it tries to match the exact path #[derive(Clone, PartialEq, Hash, Debug, Routable)]
enum Route {
#[at("/")]
Home,
#[at("/directory/{name}")]
Directory { name: String },
} Currently enum fields are interpreted as query parameters and they are attempted to be loaded from the query parameters instead of matching the named path segment. Please allow matching path segments using yew-router. Currently as far as I can tell you cannot use yew-router to match a prefix path either and then dynamically extract the rest of the path and provide content based on that information. This could be useful in places where users generate content and it is made available under a path like |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
Try |
Beta Was this translation helpful? Give feedback.
Try
#[at("/directory/:name")]
But if that does not fit your use case, in master branch we already have this feature
#[at("/directory/*name")]
we will release it in yew 0.20