Skip to main content

Crate ferrovue_router

Crate ferrovue_router 

Source
Expand description

Vue Router’s location matching, for <RouterLink> and useRoute() on the server: part of ferrovue’s runtime.

§Example

let router = ferrovue::Router::new(&["/", "/blog/:slug"]);
let route = router.at("/blog/hello");
let link = route.link("/blog/hello");
assert_eq!((link.href.as_str(), link.active, link.exact), ("/blog/hello", true, true));
assert!(!route.link("/").active);

Structs§

Link
A <RouterLink>’s to, resolved: what Route::link, Route::link_named and Route::link_path return.
Route
Where the reader is, which is what every link on the page is compared with.
RouteDef
A route as the routes file lists it: a path, its name if it has one, whether it shows a component, and the routes nested in it, rendered by the <RouterView> in its component.
Router
The routes, in the order vue-router tries them.

Enums§

Query
One value of route.query, as vue-router parses it: a key may be absent, given without a value (?flag, which is null), given once, or given more than once, which makes an array.

Functions§

query_into
stringifyQuery, one key and value at a time: key=value, each encoded as vue-router encodes them, after a & when search already holds a pair.