Require every field in router variants to be present in the route in the web history (#2159)
* require every field to be present in the URL in the web history * remove desktop only extra field from the simple routes example
This commit is contained in:
1 parent
329c323b35
commit
e8491d5cf4
4 files changed
+42
-7
No files matched your search
@@ -35,7 +35,7 @@ default = []
|
||||
ssr = ["dioxus-ssr/incremental", "tokio", "dioxus-fullstack?/server"]
|
||||
liveview = ["dioxus-liveview", "tokio", "dep:serde", "serde_json"]
|
||||
wasm_test = []
|
||||
web = ["gloo", "web-sys", "wasm-bindgen", "gloo-utils", "js-sys"]
|
||||
web = ["gloo", "web-sys", "wasm-bindgen", "gloo-utils", "js-sys", "dioxus-router-macro/web"]
|
||||
fullstack = ["dioxus-fullstack"]
|
||||
|
||||
[dev-dependencies]
|
||||
@@ -54,7 +54,6 @@ name = "incremental"
|
||||
required-features = ["ssr"]
|
||||
harness = false
|
||||
|
||||
|
||||
# you need to comment this out when publishing since cargo workspaces is not smart enough to wipe this when dropping
|
||||
# dev-dependncey crates
|
||||
[target.'cfg(target_family = "wasm")'.dev-dependencies]
|
||||
|
||||
@@ -65,17 +65,16 @@ fn UserFrame(user_id: usize) -> Element {
|
||||
}
|
||||
|
||||
#[component]
|
||||
fn Route1(user_id: usize, dynamic: usize, query: String, extra: String) -> Element {
|
||||
fn Route1(user_id: usize, dynamic: usize, query: String) -> Element {
|
||||
rsx! {
|
||||
pre {
|
||||
"Route1{{\n\tuser_id:{user_id},\n\tdynamic:{dynamic},\n\tquery:{query},\n\textra:{extra}\n}}"
|
||||
"Route1{{\n\tuser_id:{user_id},\n\tdynamic:{dynamic},\n\tquery:{query}\n}}"
|
||||
}
|
||||
Link {
|
||||
to: Route::Route1 {
|
||||
user_id,
|
||||
dynamic,
|
||||
query: String::new(),
|
||||
extra: extra.clone() + ".",
|
||||
},
|
||||
"Route1 with extra+\".\""
|
||||
}
|
||||
@@ -191,7 +190,6 @@ enum Route {
|
||||
user_id: usize,
|
||||
dynamic: usize,
|
||||
query: String,
|
||||
extra: String,
|
||||
},
|
||||
#[route("/hello_world")]
|
||||
// You can opt out of the layout by using the `!` prefix
|
||||
|
||||
Reference in new issue
Block a user