* improve documentation for the fullstack server context * Add a section about axum integration to the crate root docs * make serve_dioxus_application accept the cfg builder directly * remove unused server_fn module * improve fullstack config docs * improve documentation for the server function macro * fix axum router extension link * Fix doc tests * Fix launch builder * Simplify the launch builder * don't re-export launch in the prelude * refactor fullstack launch * Fix fullstack launch builder * Update static generation with the new builder api * fix some formatting/overly broad launch replacements * fix custom menu example * fix fullstack/static generation examples * Fix static generation launch * A few small formatting fixes * Fix a few doc tests * implement LaunchConfig for serve configs * fix fullstack launch with separate web and server launch methods * fix check with all features * dont expose inner core module * clippy and check * fix readme --------- Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
58 lines
1.8 KiB
R
58 lines
1.8 KiB
R
// This test is used by playwright configured in the root of the repo
|
|
|
|
use dioxus::prelude::*;
|
|
|
|
fn app() -> Element {
|
|
let mut num = use_signal(|| 0);
|
|
let mut eval_result = use_signal(String::new);
|
|
let a = 123;
|
|
|
|
rsx! {
|
|
div {
|
|
"hello axum! {num}"
|
|
button { class: "increment-button", onclick: move |_| num += 1, "Increment" }
|
|
}
|
|
svg { circle { cx: 50, cy: 50, r: 40, stroke: "green", fill: "yellow" } }
|
|
div { class: "raw-attribute-div", "raw-attribute": "raw-attribute-value" }
|
|
div { class: "hidden-attribute-div", hidden: true }
|
|
div {
|
|
class: "dangerous-inner-html-div",
|
|
dangerous_inner_html: "<p>hello dangerous inner html</p>"
|
|
}
|
|
input { value: "hello input" }
|
|
div { class: "style-div", color: "red", "colored text" }
|
|
div { class: "style-div", color: "red", "colored text" }
|
|
button {
|
|
class: "eval-button",
|
|
onclick: move |_| async move {
|
|
let mut eval = eval(
|
|
r#"
|
|
window.document.title = 'Hello from Dioxus Eval!';
|
|
dioxus.send("returned eval value");
|
|
"#,
|
|
);
|
|
|
|
let result = eval.recv().await;
|
|
if let Ok(serde_json::Value::String(string)) = result {
|
|
eval_result.set(string);
|
|
}
|
|
},
|
|
"Eval!!!!"
|
|
"Eval!!!!"
|
|
"Eval!!!!!"
|
|
"Eval!!!!"
|
|
"Eval!!!!"
|
|
}
|
|
div { class: "eval-result", "{eval_result}" }
|
|
}
|
|
}
|
|
|
|
fn main() {
|
|
// tracing_wasm::set_as_global_default_with_config(
|
|
// tracing_wasm::WASMLayerConfigBuilder::default()
|
|
// .set_max_level(tracing::Level::TRACE)
|
|
// .build(),
|
|
// );
|
|
dioxus::launch(app);
|
|
}
|