fix custom attribute value support
This commit is contained in:
1 parent
937eb1f0f0
commit
8a1c96a68c
28 files changed
+369
-276
No files matched your search
+15
-4
@@ -75,10 +75,21 @@ impl WebsysDom {
|
||||
value,
|
||||
id,
|
||||
ns,
|
||||
} => i.SetAttribute(id.0 as u32, name, value.into(), ns),
|
||||
SetBoolAttribute { name, value, id } => {
|
||||
i.SetBoolAttribute(id.0 as u32, name, value)
|
||||
}
|
||||
} => match value {
|
||||
dioxus_core::AttributeValue::Text(txt) => {
|
||||
i.SetAttribute(id.0 as u32, name, txt.into(), ns)
|
||||
}
|
||||
dioxus_core::AttributeValue::Float(f) => {
|
||||
i.SetAttribute(id.0 as u32, name, f.into(), ns)
|
||||
}
|
||||
dioxus_core::AttributeValue::Int(n) => {
|
||||
i.SetAttribute(id.0 as u32, name, n.into(), ns)
|
||||
}
|
||||
dioxus_core::AttributeValue::Bool(b) => {
|
||||
i.SetBoolAttribute(id.0 as u32, name, b)
|
||||
}
|
||||
_ => unreachable!(),
|
||||
},
|
||||
SetText { value, id } => i.SetText(id.0 as u32, value.into()),
|
||||
NewEventListener { name, id, .. } => {
|
||||
self.interpreter.NewEventListener(
|
||||
|
||||
@@ -187,10 +187,12 @@ pub async fn run_with_props<T: 'static>(root: fn(Scope<T>) -> Element, root_prop
|
||||
|
||||
// if should_hydrate {
|
||||
// } else {
|
||||
let edits = dom.rebuild();
|
||||
{
|
||||
let edits = dom.rebuild();
|
||||
|
||||
websys_dom.load_templates(&edits.templates);
|
||||
websys_dom.apply_edits(edits.edits);
|
||||
websys_dom.load_templates(&edits.templates);
|
||||
websys_dom.apply_edits(edits.edits);
|
||||
}
|
||||
|
||||
// the mutations come back with nothing - we need to actually mount them
|
||||
websys_dom.mount();
|
||||
|
||||
Reference in new issue
Block a user