Don't make query_segments special

This commit is contained in:
Jonathan Kelley 2024-01-19 22:27:54 -08:00
parent 2366d609d4
commit 552ce92c64
No known key found for this signature in database
GPG key ID: 1FBB50F7EB0A08BE
4 changed files with 4 additions and 27 deletions

11
Cargo.lock generated
View file

@ -2528,6 +2528,7 @@ version = "0.4.3"
dependencies = [ dependencies = [
"dioxus", "dioxus",
"dioxus-ssr", "dioxus-ssr",
"form_urlencoded",
"futures-util", "futures-util",
"getrandom 0.2.12", "getrandom 0.2.12",
"http-range", "http-range",
@ -7469,16 +7470,6 @@ dependencies = [
"bytemuck", "bytemuck",
] ]
[[package]]
name = "query_segments_demo"
version = "0.1.0"
dependencies = [
"dioxus",
"dioxus-router",
"dioxus-web",
"form_urlencoded",
]
[[package]] [[package]]
name = "quick-error" name = "quick-error"
version = "1.2.3" version = "1.2.3"

View file

@ -43,7 +43,6 @@ members = [
# Full project examples # Full project examples
"examples/tailwind", "examples/tailwind",
"examples/PWA-example", "examples/PWA-example",
"examples/query_segments_demo",
# "examples/openid_connect_demo", # "examples/openid_connect_demo",
# Playwright tests # Playwright tests
"playwright-tests/liveview", "playwright-tests/liveview",
@ -135,6 +134,7 @@ separator = "0.4.1"
serde = { version = "1.0.136", features = ["derive"] } serde = { version = "1.0.136", features = ["derive"] }
serde_json = "1.0.79" serde_json = "1.0.79"
rand = { version = "0.8.4", features = ["small_rng"] } rand = { version = "0.8.4", features = ["small_rng"] }
form_urlencoded = "1.2.0"
[target.'cfg(target_arch = "wasm32")'.dev-dependencies] [target.'cfg(target_arch = "wasm32")'.dev-dependencies]
getrandom = { version = "0.2.12", features = ["js"] } getrandom = { version = "0.2.12", features = ["js"] }

View file

@ -1,14 +1,12 @@
#![allow(unused)]
//! Example: Url query segments usage //! Example: Url query segments usage
//! ------------------------------------ //! ------------------------------------
//! //!
//! This example shows how to access and use multiple query segments present in an url on the web. //! 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` //! Run `dx serve` and navigate to `http://localhost:8080/blog?name=John&surname=Doe`
use std::fmt::Display;
use dioxus::prelude::*; use dioxus::prelude::*;
use dioxus::router::prelude::*; use dioxus::router::prelude::*;
use std::fmt::Display;
#[derive(Routable, Clone)] #[derive(Routable, Clone)]
#[rustfmt::skip] #[rustfmt::skip]
@ -19,6 +17,7 @@ enum Route {
// You must include query segments in child variants // You must include query segments in child variants
query_params: ManualBlogQuerySegments, query_params: ManualBlogQuerySegments,
}, },
// segments that follow the ?:field&:other_field syntax are query segments that follow the standard url query syntax // segments that follow the ?:field&:other_field syntax are query segments that follow the standard url query syntax
#[route("/autoblog?:name&:surname")] #[route("/autoblog?:name&:surname")]
AutomaticBlogPost { AutomaticBlogPost {

View file

@ -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"