Feat: some updates, pull in the vnode enums

This commit is contained in:
Jonathan Kelley committed 2021-01-15 02:52:47 -05:00
1 parent ce34d0dfcd
commit 152bced9f3
5 files changed
+547 -31

No files matched your search

+7 -12
View File
@@ -57,9 +57,8 @@ pub enum VirtualNode {
/// order to enable custom methods like `create_text_node()` on the
/// wrapped type.
Text(VText),
/// A User-defined componen node (node type COMPONENT_NODE)
Component(VComponent),
// /// A User-defined componen node (node type COMPONENT_NODE)
// Component(VComponent),
}
#[derive(PartialEq)]
@@ -83,9 +82,6 @@ pub struct VText {
pub text: String,
}
#[derive(PartialEq)]
pub struct VComponent {}
impl VirtualNode {
/// Create a new virtual element node with a given tag.
///
@@ -171,7 +167,7 @@ impl VirtualNode {
CreatedNode::without_closures(text_node.create_text_node())
}
VirtualNode::Element(element_node) => element_node.create_element_node().into(),
VirtualNode::Component(_) => todo!("WIP on Component Syntax"),
// VirtualNode::Component(_) => todo!("WIP on Component Syntax"),
}
}
@@ -311,10 +307,9 @@ impl VElement {
closures.extend(child.closures);
element.append_child(&child_elem).unwrap();
}
VirtualNode::Component(_) => {
todo!("WIP on Component Syntax")
}
} // VirtualNode::Component(_) => {
// todo!("WIP on Component Syntax")
// }
}
});
@@ -542,7 +537,7 @@ impl fmt::Debug for VirtualNode {
match self {
VirtualNode::Element(e) => write!(f, "Node::{:?}", e),
VirtualNode::Text(t) => write!(f, "Node::{:?}", t),
VirtualNode::Component(c) => write!(f, "Node::{:?}", c),
// VirtualNode::Component(c) => write!(f, "Node::{:?}", c),
}
}
}