wip fix component load

This commit is contained in:
Rizky 2024-03-30 14:16:19 +07:00
parent 3d0cb712ed
commit 01d50df4e3
2 changed files with 9 additions and 8 deletions

View File

@ -109,6 +109,13 @@ export const treeRebuild = async (p: PG, arg?: { note?: string }) => {
for (const mitem of mitems) {
const item = mitem.toJSON() as IItem;
if (item) {
await initLoadComp({ comps: p.comp.loaded, meta, mode: "page" }, item, {
async load(comp_ids) {
for (const id of comp_ids) {
await loadComponent(p, id);
}
},
});
genMeta(
{
note: "tree-rebuild",
@ -122,12 +129,6 @@ export const treeRebuild = async (p: PG, arg?: { note?: string }) => {
pushTreeNode(p, m, meta, p.page.tree);
}
if (m.item.component?.id) {
if (!p.comp.loaded[m.item.component.id]) {
loadComponent(p, m.item.component.id);
}
}
assignMitem({
m,
root: item,