ui: optimize resource load

This commit is contained in:
undefined committed 2021-12-19 20:51:39 +08:00
1 parent e935558702
commit f43c1bc8c9
11 files changed
+38 -40

No files matched your search

+2
View File
@@ -4,6 +4,7 @@ import _ from 'lodash';
import Notification from 'vj/components/notification';
import PageLoader from 'vj/misc/PageLoader';
import delay from 'vj/utils/delay';
import i18n from './i18n';
declare global {
interface Window {
@@ -36,6 +37,7 @@ function buildSequence(pages, type) {
async function load() {
for (const page of window.Hydro.preload) await eval(page); // eslint-disable-line no-eval
await i18n();
const pageLoader = new PageLoader();
const currentPageName = document.documentElement.getAttribute('data-page');