💥 Introduce ComponentRef to add comp's to packs

This commit is contained in:
Manuel Cillero 2023-07-19 19:18:20 +02:00
parent df2d15a839
commit 0a95f3d51c
12 changed files with 106 additions and 103 deletions

View file

@ -244,12 +244,12 @@ impl MegaMenu {
}
pub fn with_item(mut self, item: MegaMenuItem) -> Self {
self.items.alter_pack(PackOp::Add, item);
self.items.alter(PackOp::Add, ComponentRef::to(item));
self
}
pub fn alter_items(&mut self, op: PackOp, item: MegaMenuItem) -> &mut Self {
self.items.alter_pack(op, item);
self.items.alter(op, ComponentRef::to(item));
self
}