From 07e0e38ad430ec04107ce8ff2832edca286a715f Mon Sep 17 00:00:00 2001 From: tamaina Date: Tue, 26 Apr 2022 11:00:17 +0000 Subject: [PATCH] use defineAsyncComponent. --- packages/client/src/init.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/client/src/init.ts b/packages/client/src/init.ts index e32c346615..1fa9c2afe6 100644 --- a/packages/client/src/init.ts +++ b/packages/client/src/init.ts @@ -13,7 +13,7 @@ if (localStorage.getItem('accounts') != null) { } //#endregion -import { computed, createApp, watch, markRaw, version as vueVersion } from 'vue'; +import { computed, createApp, watch, markRaw, version as vueVersion, defineAsyncComponent } from 'vue'; import compareVersions from 'compare-versions'; import JSON5 from 'json5'; @@ -168,14 +168,14 @@ fetchInstanceMetaPromise.then(() => { initializeSw(); }); -const app = createApp(await ( +const app = createApp(defineAsyncComponent(() => window.location.search === '?zen' ? import('@/ui/zen.vue') : !$i ? import('@/ui/visitor.vue') : ui === 'deck' ? import('@/ui/deck.vue') : ui === 'desktop' ? import('@/ui/desktop.vue') : ui === 'classic' ? import('@/ui/classic.vue') : import('@/ui/universal.vue') -).then(x => x.default)); +)); if (_DEV_) { app.config.performance = true;