This commit is contained in:
Rizky 2024-07-15 15:59:53 +07:00
parent c1470a73e9
commit 822093253b
4 changed files with 20 additions and 8 deletions

File diff suppressed because one or more lines are too long

View File

@ -152,9 +152,13 @@ export const viEvalProps = (
if (typeof val === "function") { if (typeof val === "function") {
script.props[name].fn = val; script.props[name].fn = val;
val = (...args: any[]) => { val = new Function(
if (script) return script.props?.[name].fn(...args); `// [${meta.item.name}] ${name}: ${meta.item.id}
}; const { ${Object.keys(arg).join(", ")} } = this;
const fn = ${val.toString()}
return fn(...arguments);
`
).bind(arg);
} }
arg[name] = val; arg[name] = val;

View File

@ -28,7 +28,8 @@ export const createViLocal = (
deps?: any[]; deps?: any[];
}) => { }) => {
const isEditor = const isEditor =
["localhost", "prasi.avolut.com"].includes(location.hostname) && (["prasi.avolut.com"].includes(location.hostname) ||
location.host === "localhost:4550") &&
location.pathname.startsWith("/ed/"); location.pathname.startsWith("/ed/");
let id = meta.item.id; let id = meta.item.id;

View File

@ -66,7 +66,10 @@ export const Vi: FC<{
return pathname; return pathname;
try { try {
if (["prasi.avolut.com"].includes(location.hostname)) { if (
["prasi.avolut.com"].includes(location.hostname) ||
location.host === "localhost:4550"
) {
if (vi.site.api_url) { if (vi.site.api_url) {
if (!vi.site_url) { if (!vi.site_url) {
vi.site_url = new URL(vi.site.api_url); vi.site_url = new URL(vi.site.api_url);