fix scope
This commit is contained in:
parent
8f5c20beeb
commit
1de068c000
|
|
@ -1,6 +1,5 @@
|
||||||
import { SyncConnection } from "../type";
|
import { SyncConnection } from "../type";
|
||||||
|
|
||||||
export const site_group = async function (this: SyncConnection) {
|
export const site_group = async function (this: SyncConnection) {
|
||||||
console.log(this.user);
|
|
||||||
return "gruop";
|
return "gruop";
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,7 @@ export const Editor: FC<{ site_id: string; page_id: string; session: any }> = ({
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (p.status !== "init" && w.prasiApi) {
|
if (p.status !== "init" && w.prasiApi) {
|
||||||
for (const [k, v] of Object.entries(deepClone(EditorGlobal))) {
|
for (const [k, v] of Object.entries(EditorGlobal)) {
|
||||||
if (k === "session" || k === "site" || "status") continue;
|
if (k === "session" || k === "site" || "status") continue;
|
||||||
(p as any)[k] = v;
|
(p as any)[k] = v;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -67,8 +67,6 @@ export const treePropEval = (
|
||||||
parent_id: string;
|
parent_id: string;
|
||||||
_scopeIndex?: Record<string, string>;
|
_scopeIndex?: Record<string, string>;
|
||||||
}) => {
|
}) => {
|
||||||
console.log(prop_name);
|
|
||||||
|
|
||||||
if (prop.content) {
|
if (prop.content) {
|
||||||
const meta = p.treeMeta[prop.content.id];
|
const meta = p.treeMeta[prop.content.id];
|
||||||
if (meta) {
|
if (meta) {
|
||||||
|
|
|
||||||
|
|
@ -209,6 +209,14 @@ const createPassProp = (
|
||||||
|
|
||||||
const scopeIndex = { ..._existingScopeIndex, [meta.item.id]: arg.idx };
|
const scopeIndex = { ..._existingScopeIndex, [meta.item.id]: arg.idx };
|
||||||
|
|
||||||
|
if (!meta.scope) {
|
||||||
|
meta.scope = {};
|
||||||
|
}
|
||||||
|
for (const [k, v] of Object.entries(arg)) {
|
||||||
|
if (k === "children") continue;
|
||||||
|
meta.scope[k] = v;
|
||||||
|
}
|
||||||
|
|
||||||
return modifyChildIndex(arg.children, scopeIndex);
|
return modifyChildIndex(arg.children, scopeIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -219,6 +227,7 @@ const createPassProp = (
|
||||||
if (k === "children") continue;
|
if (k === "children") continue;
|
||||||
meta.scope[k] = v;
|
meta.scope[k] = v;
|
||||||
}
|
}
|
||||||
|
|
||||||
return arg.children;
|
return arg.children;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ export const useGlobal = <T extends object>(
|
||||||
const { global, render } = ctx;
|
const { global, render } = ctx;
|
||||||
|
|
||||||
if (!global[_id]) {
|
if (!global[_id]) {
|
||||||
global[_id] = defaultValue;
|
global[_id] = structuredClone(defaultValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue