fix
This commit is contained in:
parent
309d616afe
commit
daafef962e
File diff suppressed because one or more lines are too long
|
|
@ -206,6 +206,10 @@ export const Root = () => {
|
||||||
site_id={base.site.id}
|
site_id={base.site.id}
|
||||||
db={base.site.db}
|
db={base.site.db}
|
||||||
api={base.site.api}
|
api={base.site.api}
|
||||||
|
preloaded={(url) => {
|
||||||
|
if (base.route.router?.lookup(url)) return true;
|
||||||
|
return false;
|
||||||
|
}}
|
||||||
comp_load={async (comp_id) => {
|
comp_load={async (comp_id) => {
|
||||||
const comp = base.comp;
|
const comp = base.comp;
|
||||||
if (comp.list[comp_id]) {
|
if (comp.list[comp_id]) {
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ export const Vi: FC<{
|
||||||
mode: "mobile" | "desktop";
|
mode: "mobile" | "desktop";
|
||||||
comp_load: (comp_id: string) => Promise<IItem>;
|
comp_load: (comp_id: string) => Promise<IItem>;
|
||||||
entry: string[];
|
entry: string[];
|
||||||
|
preloaded?: (url: string) => boolean;
|
||||||
api_url: string;
|
api_url: string;
|
||||||
site_id: string;
|
site_id: string;
|
||||||
page_id: string;
|
page_id: string;
|
||||||
|
|
@ -44,6 +45,7 @@ export const Vi: FC<{
|
||||||
db,
|
db,
|
||||||
visit,
|
visit,
|
||||||
script,
|
script,
|
||||||
|
preloaded,
|
||||||
page_id,
|
page_id,
|
||||||
render_stat: rs,
|
render_stat: rs,
|
||||||
on_status_changed,
|
on_status_changed,
|
||||||
|
|
@ -99,6 +101,11 @@ export const Vi: FC<{
|
||||||
};
|
};
|
||||||
w.isMobile = mode === "mobile";
|
w.isMobile = mode === "mobile";
|
||||||
w.isDesktop = mode === "desktop";
|
w.isDesktop = mode === "desktop";
|
||||||
|
w.preloaded =
|
||||||
|
preloaded ||
|
||||||
|
((url: string) => {
|
||||||
|
false;
|
||||||
|
});
|
||||||
w.preload = (_urls: PRELOAD_ARGS["urls"], opt: PRELOAD_ARGS["opt"]) => {
|
w.preload = (_urls: PRELOAD_ARGS["urls"], opt: PRELOAD_ARGS["opt"]) => {
|
||||||
if (vi.on_preload) {
|
if (vi.on_preload) {
|
||||||
return new Promise<void>((done) => {
|
return new Promise<void>((done) => {
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ export const baseTypings = `
|
||||||
const isDesktop: boolean;
|
const isDesktop: boolean;
|
||||||
const __props: any;
|
const __props: any;
|
||||||
const siteurl: (path:string) => string;
|
const siteurl: (path:string) => string;
|
||||||
|
const preloaded: (url:string) => boolean;
|
||||||
const preload: (urls: string | string[], opt?: {
|
const preload: (urls: string | string[], opt?: {
|
||||||
on_load?: (
|
on_load?: (
|
||||||
pages: {
|
pages: {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue