Merge remote-tracking branch 'upstream/master' into optimize-templates-v3
This commit is contained in:
commit
b79ad4f50e
68 files changed
+1030
-1281
No files matched your search
@@ -132,7 +132,7 @@ impl<S: State> RealDom<S> {
|
||||
},
|
||||
OwnedAttributeValue::Text(value.to_string()),
|
||||
)),
|
||||
dioxus_core::TemplateAttribute::Dynamic(_) => None,
|
||||
dioxus_core::TemplateAttribute::Dynamic { .. } => None,
|
||||
})
|
||||
.collect(),
|
||||
listeners: FxHashSet::default(),
|
||||
@@ -144,17 +144,17 @@ impl<S: State> RealDom<S> {
|
||||
}
|
||||
node_id
|
||||
}
|
||||
TemplateNode::Text(txt) => {
|
||||
TemplateNode::Text { text } => {
|
||||
let node_id = self.create_node(Node::new(NodeType::Text {
|
||||
text: txt.to_string(),
|
||||
text: text.to_string(),
|
||||
}));
|
||||
node_id
|
||||
}
|
||||
TemplateNode::Dynamic(_) => {
|
||||
TemplateNode::Dynamic { .. } => {
|
||||
let node_id = self.create_node(Node::new(NodeType::Placeholder));
|
||||
node_id
|
||||
}
|
||||
TemplateNode::DynamicText(_) => {
|
||||
TemplateNode::DynamicText { .. } => {
|
||||
let node_id = self.create_node(Node::new(NodeType::Text {
|
||||
text: String::new(),
|
||||
}));
|
||||
@@ -220,7 +220,12 @@ impl<S: State> RealDom<S> {
|
||||
let node = self.tree.get_mut(node_id).unwrap();
|
||||
if let NodeType::Text { text } = &mut node.node_data.node_type {
|
||||
*text = value.to_string();
|
||||
} else {
|
||||
node.node_data.node_type = NodeType::Text {
|
||||
text: value.to_string(),
|
||||
};
|
||||
}
|
||||
|
||||
mark_dirty(node_id, NodeMask::new().with_text(), &mut nodes_updated);
|
||||
}
|
||||
LoadTemplate { name, index, id } => {
|
||||
|
||||
Reference in new issue
Block a user