This commit is contained in:
Rizky 2024-03-31 10:02:41 +07:00
parent cda1a66c60
commit 6910088b0a
4 changed files with 13 additions and 5 deletions

View File

@ -16,10 +16,18 @@ import { SideLabel } from "./ui/SideLabel";
export const EdStyleAll = () => {
const p = useGlobal(EDGlobal, "EDITOR");
const meta = active.comp_id
let meta = active.comp_id
? p.comp.list[active.comp_id].meta[active.item_id]
: p.page.meta[active.item_id];
if (
meta.item.component?.props?.child &&
meta.item.component?.props?.child?.content?.id &&
meta.item.component?.useStyle
) {
meta = p.page.meta[meta.item.component.props.child.content.id];
}
let item = meta?.item;
let is_inherit = false;
if (item?.component?.id) {

View File

@ -100,7 +100,7 @@ export const EdTreeAction = ({
)}
onClick={(e) => {
if (
item.component?.props.child.content?.id &&
item.component?.props?.child?.content?.id &&
child_jsx_has_script
) {
e.stopPropagation();

View File

@ -238,7 +238,7 @@ const GenerateJSX: FC<{ meta: IMeta }> = ({ meta }) => {
}
if (mitem) {
const genJSX = fillID(findDefaultJSX(p, mitem));
const genJSX = findDefaultJSX(p, mitem);
const ijson = mitem.toJSON() as IItem;
mitem.doc?.transact(() => {
@ -307,5 +307,5 @@ export const findDefaultJSX = (p: PG, mitem: MItem): IItem => {
}
}
return resetJSXProp;
return fillID(resetJSXProp) as any;
};

View File

@ -61,7 +61,7 @@ export const nodeOnDrop: (
treeRebuild(p);
p.render();
} else {
const child_id = toMeta.item.component?.props.child.content?.id;
const child_id = toMeta.item.component?.props?.child?.content?.id;
if (child_id) {
const child_meta = getMetaById(p, child_id);
if (child_meta) {