|
@@ -11,6 +11,8 @@ use crate::navigation::NavigationTarget;
|
|
use crate::prelude::Routable;
|
|
use crate::prelude::Routable;
|
|
use crate::utils::use_router_internal::use_router_internal;
|
|
use crate::utils::use_router_internal::use_router_internal;
|
|
|
|
|
|
|
|
+use url::Url;
|
|
|
|
+
|
|
/// Something that can be converted into a [`NavigationTarget`].
|
|
/// Something that can be converted into a [`NavigationTarget`].
|
|
#[derive(Clone)]
|
|
#[derive(Clone)]
|
|
pub enum IntoRoutable {
|
|
pub enum IntoRoutable {
|
|
@@ -53,6 +55,18 @@ impl From<&str> for IntoRoutable {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+impl From<Url> for IntoRoutable {
|
|
|
|
+ fn from(url: Url) -> Self {
|
|
|
|
+ IntoRoutable::FromStr(url.to_string())
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+impl From<&Url> for IntoRoutable {
|
|
|
|
+ fn from(url: &Url) -> Self {
|
|
|
|
+ IntoRoutable::FromStr(url.to_string())
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
/// The properties for a [`Link`].
|
|
/// The properties for a [`Link`].
|
|
#[derive(Props)]
|
|
#[derive(Props)]
|
|
pub struct LinkProps<'a> {
|
|
pub struct LinkProps<'a> {
|