fix prop options
This commit is contained in:
parent
60facdb7ac
commit
ff1f2e2062
|
|
@ -13,7 +13,7 @@ export const parseJs = (code?: string, show_error?: boolean) => {
|
|||
const result = {} as {
|
||||
local?: typeof local | undefined;
|
||||
passprop?: typeof passprop | undefined;
|
||||
props?: Record<string, { value: string; fn?: any; visible?: boolean }>;
|
||||
props?: Record<string, { value: string; valueBuilt: string; fn?: any; visible?: boolean }>;
|
||||
};
|
||||
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -111,6 +111,7 @@ export const EdPropInstanceOptions: FC<{
|
|||
cprop.meta.options ||
|
||||
""
|
||||
).trim();
|
||||
|
||||
const final = `
|
||||
try {
|
||||
const resOpt = ${src.endsWith(";") ? src : `${src};`}
|
||||
|
|
@ -145,14 +146,19 @@ export const EdPropInstanceOptions: FC<{
|
|||
local.options = e;
|
||||
|
||||
if (local.resetOnDeps) {
|
||||
const val = meta.item.component?.props?.[name]?.value;
|
||||
const valBuilt = meta.item.component?.props?.[name]?.valueBuilt;
|
||||
if (val && valBuilt) {
|
||||
mprop.doc?.transact(() => {
|
||||
mprop.set("value", "null");
|
||||
mprop.set("valueBuilt", "null");
|
||||
mprop.set("value", val);
|
||||
mprop.set("valueBuilt", valBuilt);
|
||||
});
|
||||
|
||||
treeRebuild(p);
|
||||
p.render();
|
||||
}
|
||||
|
||||
}
|
||||
local.render();
|
||||
};
|
||||
if (res instanceof Promise) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue