Merge branch 'master' into intigrate-collect-assets
This commit is contained in:
1 parent
ffb5de91d1
commit
f976e08f71
379 files changed
+1962
-13517
No files matched your search
@@ -1,24 +1,23 @@
|
||||
#![allow(non_snake_case)]
|
||||
|
||||
use dioxus::prelude::*;
|
||||
use dioxus_router::prelude::*;
|
||||
use std::str::FromStr;
|
||||
|
||||
fn main() {
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
dioxus_desktop::launch(root);
|
||||
dioxus_desktop::launch(Root);
|
||||
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
dioxus_web::launch(root);
|
||||
}
|
||||
|
||||
fn root(cx: Scope) -> Element {
|
||||
#[component]
|
||||
fn Root(cx: Scope) -> Element {
|
||||
render! {
|
||||
Router::<Route> {}
|
||||
}
|
||||
}
|
||||
|
||||
#[inline_props]
|
||||
#[component]
|
||||
fn UserFrame(cx: Scope, user_id: usize) -> Element {
|
||||
render! {
|
||||
pre {
|
||||
@@ -32,7 +31,7 @@ fn UserFrame(cx: Scope, user_id: usize) -> Element {
|
||||
}
|
||||
}
|
||||
|
||||
#[inline_props]
|
||||
#[component]
|
||||
fn Route1(cx: Scope, user_id: usize, dynamic: usize, query: String, extra: String) -> Element {
|
||||
render! {
|
||||
pre {
|
||||
@@ -50,7 +49,7 @@ fn Route1(cx: Scope, user_id: usize, dynamic: usize, query: String, extra: Strin
|
||||
}
|
||||
}
|
||||
|
||||
#[inline_props]
|
||||
#[component]
|
||||
fn Route2(cx: Scope, user_id: usize) -> Element {
|
||||
render! {
|
||||
pre {
|
||||
@@ -65,7 +64,7 @@ fn Route2(cx: Scope, user_id: usize) -> Element {
|
||||
}
|
||||
}
|
||||
|
||||
#[inline_props]
|
||||
#[component]
|
||||
fn Route3(cx: Scope, dynamic: String) -> Element {
|
||||
let navigator = use_navigator(cx);
|
||||
let current_route = use_route(cx)?;
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#![allow(non_snake_case)]
|
||||
|
||||
use std::time::Duration;
|
||||
|
||||
use dioxus::prelude::*;
|
||||
@@ -54,7 +52,7 @@ async fn main() {
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
#[inline_props]
|
||||
#[component]
|
||||
fn Blog(cx: Scope) -> Element {
|
||||
render! {
|
||||
div {
|
||||
@@ -63,7 +61,7 @@ fn Blog(cx: Scope) -> Element {
|
||||
}
|
||||
}
|
||||
|
||||
#[inline_props]
|
||||
#[component]
|
||||
fn Post(cx: Scope, id: usize) -> Element {
|
||||
render! {
|
||||
div {
|
||||
@@ -72,7 +70,7 @@ fn Post(cx: Scope, id: usize) -> Element {
|
||||
}
|
||||
}
|
||||
|
||||
#[inline_props]
|
||||
#[component]
|
||||
fn PostHome(cx: Scope) -> Element {
|
||||
render! {
|
||||
div {
|
||||
@@ -81,7 +79,7 @@ fn PostHome(cx: Scope) -> Element {
|
||||
}
|
||||
}
|
||||
|
||||
#[inline_props]
|
||||
#[component]
|
||||
fn Home(cx: Scope) -> Element {
|
||||
render! {
|
||||
div {
|
||||
|
||||
Reference in new issue
Block a user