feat(not_found): commit HTTP 404 status code during SSR
This commit is contained in:
parent
1b38162ca4
commit
8cf34769e5
@ -17,6 +17,15 @@ use crate::router::Route;
|
|||||||
pub fn NotFound(segments: Vec<String>) -> Element {
|
pub fn NotFound(segments: Vec<String>) -> Element {
|
||||||
let _ = segments;
|
let _ = segments;
|
||||||
|
|
||||||
|
// Commit 404 status code during server-side rendering
|
||||||
|
#[cfg(feature = "server")]
|
||||||
|
{
|
||||||
|
dioxus::fullstack::FullstackContext::commit_http_status(
|
||||||
|
http::StatusCode::NOT_FOUND,
|
||||||
|
Some("Page Not Found".to_string()),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
rsx! {
|
rsx! {
|
||||||
div { class: "flex flex-col items-center justify-center text-center min-h-[50vh] md:min-h-[55vh] px-6",
|
div { class: "flex flex-col items-center justify-center text-center min-h-[50vh] md:min-h-[55vh] px-6",
|
||||||
// 巨大的装饰性 404,作为视觉锚点
|
// 巨大的装饰性 404,作为视觉锚点
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user