perf: faster app without defineAsync

This commit is contained in:
2026-08-02 08:59:13 +02:00
parent fe5c0f94b2
commit f680b04533
7 changed files with 17 additions and 34 deletions
+7 -11
View File
@@ -1,20 +1,16 @@
<script setup lang="ts">
import { getMetadata } from "@/api/meta";
import type { Metadata } from "@/types";
import { defineAsyncComponent, onBeforeMount, ref } from "vue";
import { onBeforeMount, ref } from "vue";
import LangInput from "@/components/LangInput.vue";
const metadata = ref<Metadata|null>(null);
const LangInput = defineAsyncComponent(
() => import("@/components/LangInput.vue"),
);
const metadata = ref<Metadata | null>(null);
function fetchMetadata() {
void getMetadata()
.then((data) => {
metadata.value = data;
setTimeout(fetchMetadata, 600000);
});
void getMetadata().then((data) => {
metadata.value = data;
setTimeout(fetchMetadata, 600000);
});
}
onBeforeMount(fetchMetadata);