fix
This commit is contained in:
parent
374fa9a145
commit
fcb80a49d0
|
|
@ -52,6 +52,14 @@ export const EdPropInstanceOptions: FC<{
|
||||||
|
|
||||||
if (cprop.meta?.options || cprop.meta?.optionsBuilt) {
|
if (cprop.meta?.options || cprop.meta?.optionsBuilt) {
|
||||||
if (!local.loaded || !local.metaFn) {
|
if (!local.loaded || !local.metaFn) {
|
||||||
|
const src = (cprop.meta.optionsBuilt || cprop.meta.options || "").trim();
|
||||||
|
const final = `
|
||||||
|
try {
|
||||||
|
const resOpt = ${src.endsWith(";") ? src : `${src};`}
|
||||||
|
|
||||||
|
if (typeof resOpt === 'function') local.metaFn = resOpt;
|
||||||
|
else local.options = resOpt;
|
||||||
|
} catch(e) { console.error(e); }`;
|
||||||
try {
|
try {
|
||||||
if (p.site.config.api_url) {
|
if (p.site.config.api_url) {
|
||||||
if (!p.script.db) p.script.db = dbProxy(p.site.config.api_url);
|
if (!p.script.db) p.script.db = dbProxy(p.site.config.api_url);
|
||||||
|
|
@ -92,32 +100,11 @@ export const EdPropInstanceOptions: FC<{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const src = (
|
const res = new Function(...Object.keys(arg), "local", final);
|
||||||
cprop.meta.optionsBuilt ||
|
|
||||||
cprop.meta.options ||
|
|
||||||
""
|
|
||||||
).trim();
|
|
||||||
const res = new Function(
|
|
||||||
...Object.keys(arg),
|
|
||||||
"local",
|
|
||||||
`
|
|
||||||
try {
|
|
||||||
const resOpt = ${src.endsWith(";") ? src : `${src};`}
|
|
||||||
|
|
||||||
if (typeof resOpt === 'function') local.metaFn = resOpt;
|
|
||||||
else local.options = resOpt;
|
|
||||||
} catch(e) { console.error(e); }`
|
|
||||||
);
|
|
||||||
res(...Object.values(arg), local);
|
res(...Object.values(arg), local);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
console.warn(`
|
console.warn(final);
|
||||||
try {
|
|
||||||
const resOpt = ${cprop.meta.optionsBuilt || cprop.meta.options};
|
|
||||||
|
|
||||||
if (typeof resOpt === 'function') local.metaFn = resOpt;
|
|
||||||
else local.options = resOpt;
|
|
||||||
} catch(e) { console.error(e); }`);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
local.options = local.loaded;
|
local.options = local.loaded;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue