diff --git a/Cargo.lock b/Cargo.lock index 9c81efb5d..ccfff28bd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2528,6 +2528,7 @@ version = "0.4.3" dependencies = [ "dioxus", "dioxus-ssr", + "form_urlencoded", "futures-util", "getrandom 0.2.12", "http-range", @@ -7469,16 +7470,6 @@ dependencies = [ "bytemuck", ] -[[package]] -name = "query_segments_demo" -version = "0.1.0" -dependencies = [ - "dioxus", - "dioxus-router", - "dioxus-web", - "form_urlencoded", -] - [[package]] name = "quick-error" version = "1.2.3" diff --git a/Cargo.toml b/Cargo.toml index c678ec4fe..0169c8761 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,7 +43,6 @@ members = [ # Full project examples "examples/tailwind", "examples/PWA-example", - "examples/query_segments_demo", # "examples/openid_connect_demo", # Playwright tests "playwright-tests/liveview", @@ -135,6 +134,7 @@ separator = "0.4.1" serde = { version = "1.0.136", features = ["derive"] } serde_json = "1.0.79" rand = { version = "0.8.4", features = ["small_rng"] } +form_urlencoded = "1.2.0" [target.'cfg(target_arch = "wasm32")'.dev-dependencies] getrandom = { version = "0.2.12", features = ["js"] } diff --git a/examples/query_segments_demo/src/main.rs b/examples/query_segments.rs similarity index 99% rename from examples/query_segments_demo/src/main.rs rename to examples/query_segments.rs index 51f2fbe87..16c68f256 100644 --- a/examples/query_segments_demo/src/main.rs +++ b/examples/query_segments.rs @@ -1,14 +1,12 @@ -#![allow(unused)] //! Example: Url query segments usage //! ------------------------------------ //! //! This example shows how to access and use multiple query segments present in an url on the web. //! //! Run `dx serve` and navigate to `http://localhost:8080/blog?name=John&surname=Doe` -use std::fmt::Display; - use dioxus::prelude::*; use dioxus::router::prelude::*; +use std::fmt::Display; #[derive(Routable, Clone)] #[rustfmt::skip] @@ -19,6 +17,7 @@ enum Route { // You must include query segments in child variants query_params: ManualBlogQuerySegments, }, + // segments that follow the ?:field&:other_field syntax are query segments that follow the standard url query syntax #[route("/autoblog?:name&:surname")] AutomaticBlogPost { diff --git a/examples/query_segments_demo/Cargo.toml b/examples/query_segments_demo/Cargo.toml deleted file mode 100644 index ee9f49c70..000000000 --- a/examples/query_segments_demo/Cargo.toml +++ /dev/null @@ -1,13 +0,0 @@ -[package] -name = "query_segments_demo" -version = "0.1.0" -edition = "2021" -publish = false - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] -dioxus = { path = "../../packages/dioxus", version = "*" } -dioxus-router = { path = "../../packages/router", version = "*" } -dioxus-web = { path = "../../packages/web", version = "*" } -form_urlencoded = "1.2.0"