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