chore: get create working and simplify dynamic nodes
This commit is contained in:
1 parent
16a521a601
commit
3c19def550
16 files changed
+168
-173
No files matched your search
@@ -89,13 +89,17 @@ pub enum TemplateNode<'a> {
|
||||
pub enum DynamicNode<'a> {
|
||||
Component(VComponent<'a>),
|
||||
Text(VText<'a>),
|
||||
Fragment(VFragment<'a>),
|
||||
Placeholder(Cell<ElementId>),
|
||||
Fragment(&'a [VNode<'a>]),
|
||||
}
|
||||
|
||||
impl<'a> DynamicNode<'a> {
|
||||
pub fn is_component(&self) -> bool {
|
||||
matches!(self, DynamicNode::Component(_))
|
||||
}
|
||||
pub fn placeholder() -> Self {
|
||||
Self::Placeholder(Cell::new(ElementId(0)))
|
||||
}
|
||||
}
|
||||
|
||||
pub struct VComponent<'a> {
|
||||
@@ -122,12 +126,6 @@ pub struct VText<'a> {
|
||||
pub value: &'a str,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum VFragment<'a> {
|
||||
Empty(Cell<ElementId>),
|
||||
NonEmpty(&'a [VNode<'a>]),
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum TemplateAttribute<'a> {
|
||||
Static {
|
||||
|
||||
Reference in new issue
Block a user