docs: examples
This commit is contained in:
1 parent
818043e5e4
commit
d9e6d0925b
33 files changed
+732
-152
No files matched your search
@@ -768,6 +768,25 @@ impl<'a> NodeFactory<'a> {
|
||||
> {
|
||||
ElementBuilder::new(self, tag_name)
|
||||
}
|
||||
|
||||
pub fn child_list(&self) -> ChildrenList {
|
||||
ChildrenList::new(&self)
|
||||
}
|
||||
|
||||
pub fn fragment_builder<'b>(
|
||||
&'b self,
|
||||
key: Option<&'a str>,
|
||||
builder: impl FnOnce(ChildrenList<'a, 'b>) -> &'a [VNode<'a>],
|
||||
) -> VNode<'a> {
|
||||
self.fragment(builder(ChildrenList::new(&self)), key)
|
||||
}
|
||||
|
||||
pub fn fragment(&self, children: &'a [VNode<'a>], key: Option<&'a str>) -> VNode<'a> {
|
||||
VNode::Fragment(self.bump().alloc(VFragment {
|
||||
children,
|
||||
key: NodeKey::new_opt(key),
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
||||
use std::fmt::Debug;
|
||||
|
||||
Reference in new issue
Block a user