fix readme expanded example
This commit is contained in:
1 parent
9d044ee589
commit
cbf8a1e158
1 file changed
+7
-9
@@ -84,24 +84,22 @@ fn app(cx: Scope) -> Element {
|
|||||||
],
|
],
|
||||||
};
|
};
|
||||||
// The VNode is a reference to the template with the dynamic parts of the rsx
|
// The VNode is a reference to the template with the dynamic parts of the rsx
|
||||||
::dioxus::core::VNode {
|
::dioxus::core::VNode::new(
|
||||||
parent: Default::default(),
|
None,
|
||||||
key: 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
|
// 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),
|
TEMPLATE,
|
||||||
root_ids: dioxus::core::exports::bumpalo::collections::Vec::new_in(__cx.bump())
|
dioxus::core::exports::bumpalo::collections::Vec::new_in(__cx.bump()),
|
||||||
.into(),
|
__cx.bump().alloc([
|
||||||
dynamic_nodes: __cx.bump().alloc([
|
|
||||||
// The dynamic count text node (dynamic node id 0)
|
// The dynamic count text node (dynamic node id 0)
|
||||||
__cx.text_node(format_args!("High-Five counter: {0}", count)),
|
__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)
|
// The dynamic up high button onclick listener (dynamic attribute id 0)
|
||||||
dioxus_elements::events::onclick(__cx, move |_| count += 1),
|
dioxus_elements::events::onclick(__cx, move |_| count += 1),
|
||||||
// The dynamic down low button onclick listener (dynamic attribute id 1)
|
// The dynamic down low button onclick listener (dynamic attribute id 1)
|
||||||
dioxus_elements::events::onclick(__cx, move |_| count -= 1),
|
dioxus_elements::events::onclick(__cx, move |_| count -= 1),
|
||||||
]),
|
]),
|
||||||
}
|
)
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in new issue
Block a user