feat: rebuild doesn't return errors
This commit is contained in:
1 parent
df8aa77198
commit
f457b71131
18 files changed
+233
-189
No files matched your search
@@ -1,19 +1,17 @@
|
||||
//! Basic example that renders a simple VNode to the browser.
|
||||
|
||||
// all these imports are done automatically with the `dioxus` crate and `prelude`
|
||||
// need to do them manually for this example
|
||||
use dioxus::events::on::MouseEvent;
|
||||
use dioxus_core as dioxus;
|
||||
use dioxus_core::prelude::*;
|
||||
use dioxus_hooks::*;
|
||||
use dioxus_html as dioxus_elements;
|
||||
// use wasm_timer;
|
||||
|
||||
use std::future::Future;
|
||||
|
||||
use std::{pin::Pin, time::Duration};
|
||||
|
||||
use dioxus::prelude::*;
|
||||
|
||||
use dioxus_web::*;
|
||||
use std::future::Future;
|
||||
use std::{pin::Pin, time::Duration};
|
||||
|
||||
fn main() {
|
||||
// Setup logging
|
||||
@@ -21,17 +19,33 @@ fn main() {
|
||||
console_error_panic_hook::set_once();
|
||||
|
||||
// Run the app
|
||||
dioxus_web::launch(App, |c| c)
|
||||
dioxus_web::launch(APP, |c| c)
|
||||
}
|
||||
|
||||
static App: FC<()> = |cx| {
|
||||
static APP: FC<()> = |cx| {
|
||||
let mut count = use_state(cx, || 3);
|
||||
|
||||
cx.render(rsx! {
|
||||
div {
|
||||
button {
|
||||
"add"
|
||||
onclick: move |_| count += 1
|
||||
button { onclick: move |_| count += 1, "add" }
|
||||
div {
|
||||
div {
|
||||
div {
|
||||
div {
|
||||
div {
|
||||
Fragment {
|
||||
a {"wo"}
|
||||
p {"wo"}
|
||||
li {"wo"}
|
||||
em {"wo"}
|
||||
}
|
||||
}
|
||||
}
|
||||
Child {}
|
||||
}
|
||||
Child {}
|
||||
}
|
||||
Child {}
|
||||
}
|
||||
ul {
|
||||
{(0..*count).map(|f| rsx!{
|
||||
@@ -43,3 +57,15 @@ static App: FC<()> = |cx| {
|
||||
}
|
||||
})
|
||||
};
|
||||
|
||||
static Child: FC<()> = |cx| {
|
||||
cx.render(rsx! {
|
||||
div {
|
||||
div {
|
||||
div {
|
||||
"hello child"
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
};
|
||||
Reference in new issue
Block a user