fix render
This commit is contained in:
parent
3bab393c5d
commit
7e9efb848a
|
|
@ -1,5 +1,5 @@
|
|||
import { FC, ReactNode, useEffect, useState } from "react";
|
||||
import { useGlobal, useLocal } from "web-utils";
|
||||
import { deepClone, useGlobal, useLocal } from "web-utils";
|
||||
import { produceCSS } from "../../../utils/css/gen";
|
||||
import { IContent } from "../../../utils/types/general";
|
||||
import { FNAdv, FNCompDef, FNLinkTag } from "../../../utils/types/meta-fn";
|
||||
|
|
@ -95,21 +95,10 @@ export const LRenderInternal: FC<{
|
|||
let props = {} as Record<string, FNCompDef>;
|
||||
let cprops = {} as [string, FNCompDef][];
|
||||
|
||||
if (meta.comp.mcomp) {
|
||||
props = meta.comp.mcomp
|
||||
.get("component")
|
||||
?.get("props")
|
||||
?.toJSON() as Record<string, FNCompDef>;
|
||||
|
||||
cprops = Object.entries(props).sort((a, b) => {
|
||||
return a[1].idx - b[1].idx;
|
||||
});
|
||||
} else {
|
||||
props = structuredClone(
|
||||
props = deepClone(
|
||||
p.comps.all[meta.comp.id]?.content_tree.component?.props || {}
|
||||
);
|
||||
cprops = Object.entries(props);
|
||||
}
|
||||
|
||||
comp.propval = treePropEval(p, id, cprops, _scopeIndex);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import { IRoot } from "../../../utils/types/root";
|
|||
import { fillID } from "../../editor/tools/fill-id";
|
||||
import { PG } from "./global";
|
||||
import { PRASI_COMPONENT } from "../../../utils/types/render";
|
||||
import { deepClone } from "web-utils";
|
||||
|
||||
export const scanComponent = (
|
||||
item: IRoot | IContent,
|
||||
|
|
@ -97,7 +98,7 @@ export const instantiateComp = (
|
|||
}
|
||||
target = mitem.toJSON();
|
||||
} else {
|
||||
target = structuredClone(mcomp.item.content_tree);
|
||||
target = deepClone(mcomp.item.content_tree);
|
||||
mprops = target.component.props || {};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue