mirror of
https://github.com/DioxusLabs/dioxus
synced 2025-02-17 14:18:27 +00:00
fix readme expanded example
This commit is contained in:
parent
9d044ee589
commit
cbf8a1e158
1 changed files with 7 additions and 9 deletions
|
@ -84,24 +84,22 @@ fn app(cx: Scope) -> Element {
|
|||
],
|
||||
};
|
||||
// The VNode is a reference to the template with the dynamic parts of the rsx
|
||||
::dioxus::core::VNode {
|
||||
parent: Default::default(),
|
||||
key: None,
|
||||
::dioxus::core::VNode::new(
|
||||
None,
|
||||
// The static template this node will use. The template is stored in a Cell so it can be replaced with a new template when hot rsx reloading is enabled
|
||||
template: std::cell::Cell::new(TEMPLATE),
|
||||
root_ids: dioxus::core::exports::bumpalo::collections::Vec::new_in(__cx.bump())
|
||||
.into(),
|
||||
dynamic_nodes: __cx.bump().alloc([
|
||||
TEMPLATE,
|
||||
dioxus::core::exports::bumpalo::collections::Vec::new_in(__cx.bump()),
|
||||
__cx.bump().alloc([
|
||||
// The dynamic count text node (dynamic node id 0)
|
||||
__cx.text_node(format_args!("High-Five counter: {0}", count)),
|
||||
]),
|
||||
dynamic_attrs: __cx.bump().alloc([
|
||||
__cx.bump().alloc([
|
||||
// The dynamic up high button onclick listener (dynamic attribute id 0)
|
||||
dioxus_elements::events::onclick(__cx, move |_| count += 1),
|
||||
// The dynamic down low button onclick listener (dynamic attribute id 1)
|
||||
dioxus_elements::events::onclick(__cx, move |_| count -= 1),
|
||||
]),
|
||||
}
|
||||
)
|
||||
},
|
||||
),
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue