fix
This commit is contained in:
parent
c1470a73e9
commit
822093253b
File diff suppressed because one or more lines are too long
|
|
@ -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;
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue